0

我在 Android JellyBean 中使用 WebView。

我有样式元素:

    <style type="text/css">
    div.d1{margin-right:0.74791664in;  margin-left:0.74791664in;}
    div.d2{margin-right:0.74791664in;  margin-left:0.74791664in;max-height:10.820139in;min-height:10.820139in;}

    p.p1{text-align:justify;hyphenate:auto;font-family:David;font-size:12pt;}
    p.p2{text-align:center;hyphenate:auto;font-family:David;font-size:12pt;}
    p.p3{text-align:justify;direction:rtl;hyphenate:auto;font-family:David;font-size:8pt;}
    p.p4{padding-right:-4pt;text-align:center;direction:rtl;hyphenate:auto;keep-together.within-page:always;keep-with-next.within-page:always;font-family:David Bold Bold;font-size:36pt;}

    p.p5{text-indent:-18pt;padding-right:35pt;text-align:justify;direction:rtl;hyphenate:auto;keep-together.within-page:always;font-family:David;font-size:12pt;}

    p.p6{padding-left:90pt;padding-right:82pt;text-align:justify;direction:rtl;hyphenate:none;font-family:David Bold Bold;font-size:12pt;}

    p.p7{text-align:justify;direction:rtl;hyphenate:auto;keep-together.within-page:always;font-family:David;font-size:12pt;}

    p.p8{padding-left:90pt;padding-right:82pt;text-align:justify;hyphenate:none;font-family:David Bold Bold;font-size:12pt;}

    p.p9{text-align:justify;direction:rtl;hyphenate:auto;font-family:David;font-size:12pt;}
    span.s1{font-family:David;}

    span.s2{font-family:David Bold;font-weight:bold;text-decoration:underline;}
    span.s3{font-family:David Bold;font-weight:bold;}
    span.s4{font-family:Times New Roman;font-size:10pt;}
    span.s5{white-space:pre-wrap;}

    </style>

这是在 HTML 中:

<p class"p5">
<span class="s1">"why is the 
<b>bold</b> 
Not Bold???</span>
</p>

我的问题是粗体标签没有使文本变粗。这是为什么?

在 Google Chrome 中它确实有效,但我需要它在 Android WebView 中工作。

4

1 回答 1

0

你真的必须使用<b>标签吗?您也可以使用<strong>. 看看它是否有效。或者,您可以尝试这样的事情:

<p class"p5">
<span class="s1">"why is the 
<span class="bld">bold</span> 
Not Bold???</span>
</p>

然后在你的CSS上,添加:

span.bld{字体粗细:粗体;}

于 2013-09-17T09:40:22.890 回答