【问题标题】:how to Load a css file for html page android web view如何为html页面android web视图加载css文件
【发布时间】:2011-03-07 05:23:24
【问题描述】:

如何每次都将特定的 css 文件链接到 html 页面。css 文件存储在 sdcard 文件夹中。并且 html 页面包含 css 文件的相对路径。我使用了 loadwithbaseurl(),但它不起作用...

【问题讨论】:

标签: android css webview


【解决方案1】:

如果我正确理解您的问题,它应该像在 HTML/模板的头部使用 <link href 一样简单(和标准):

<link href="css/stylesheet.css" media="screen" rel="stylesheet" type="text/css" />

只需将目标调整到您的 CSS 文件所在的位置即可。

这就是你的意思吗?

【讨论】:

  • 我的 html 页面不打算编辑。在 html 页面中有一个相对链接:link href="/links/0.css" type="text/css" rel="stylesheet"。我有 0.css 文件。这个需要放在哪里?
猜你喜欢
  • 1970-01-01
  • 2013-01-23
  • 2019-11-11
  • 2012-02-13
  • 1970-01-01
  • 1970-01-01
  • 2010-11-14
  • 1970-01-01
  • 2015-05-05
相关资源
最近更新 更多