【发布时间】:2011-10-30 23:49:24
【问题描述】:
我正在从 SQLite 数据库加载 html 内容。从数据库中获取内容后,我正在使用 webview.loadData 从字符串中加载内容。
我的 html 文件中有 CSS,但在显示页面时它没有加载。所有的内容都在那里,但根本没有样式。这是我从数据库加载的 html。
<html>
<head>
<title></title>
<style type="text/css">
.Heading { font-weight: bold; font-size: 14px; color: #000066; margin-top: 5px; }
.TextBody { font-size: 14px; margin-top: 5px; margin-right: 5px; margin-left: 5px; }
.UL { }
</style>
</head>
<body>
<div class="Heading">My Heading</div>
<div class="TextBody">My text.</div>
</body>
</html>
有谁知道为什么 CSS 在内部样式表中不适合我?我不认为将 CSS 存储在资产中对我有用,因为我正在从数据库中提取 html。
谢谢!
【问题讨论】: