아래 코드는 굵게 표시되지 않습니다. 내가 font:inherit;
을 주석 처리하면 예상대로 작동합니다.CSS 굵게가 작동하지 않습니다.
이유가 무엇인지 이해가되지 않습니다. 나는 <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 개의 단락이 있습니다. 첫 번째 파는 정상이며 두 번째 파는 굵은 글씨입니다. 상속을 사용하면 두 줄의 글꼴 두께가 같아집니다.
"작동하지 않음"이란 정확히 무엇을 의미합니까? –