以下のコードでは、太字が機能していません。コメントアウトするfont:inherit;
と、期待どおりに機能します。
これがなぜなのかわかりません。<p>
から継承し<body>
、太字が機能すると思いました。Firefox、IE、Safari、Opera でまったく同じことがわかります。
私は何が欠けていますか?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700,bold' rel='stylesheet' type='text/css' />
<style type="text/css">
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video{
font:inherit;
}
body{
font-family:'Droid Sans', sans-serif,Arial,Helvetica,'Trebuchet MS';
font-size:14px;
}
</style>
</head>
<body>
<p>this is a normal paragraph</p>
<p><strong>this is bolded</strong></p>
</body>
</html>
編集:「機能しない」とは、太字のフォントが表示されないことを意味します。html には 2 つの段落があります。最初のパーは通常のパーで、2 番目のパーはボールドです。継承を使用すると、両方の行のフォントの太さが同じになります。