CSS設(shè)置字體——異體和粗細(xì)
<1>.異體
font-variant屬性可以設(shè)定小型大寫字母。
小型大寫字母不是一般的大寫字母,
也不是小寫字母,這種字母采用不同大小的大寫字母。
1 <html>
2 <head>
3 <style type="text/css">
4 p.normal {font-variant:normal}
5 p.small {font-variant: small-caps}
6 </style>
7 </head>
8
9 <body>
10 <p class="normal">This is a paragraph</p>
11 <p class="small">This is a paragraph</p>
12 </body>
13 </html>
<2>.粗細(xì)
1 <html>
2 <head>
3 <style type="text/css">
4 p.normal {font-weight: normal}
5 p.thick {font-weight: bold}
6 p.thicker {font-weight: 900}
7 </style>
8 </head>
9
10 <body>
11 <p class="normal">This is a paragraph</p>
12 <p class="thick">This is a paragraph</p>
13 <p class="thicker">This is a paragraph</p>
14 </body>
15 </html>
關(guān)鍵字 100 ~ 900 為字體指定了 9 級(jí)加粗度。
如果一個(gè)字體內(nèi)置了這些加粗級(jí)別,
那么這些數(shù)字就直接映射到預(yù)定義的級(jí)別,
100 對(duì)應(yīng)最細(xì)的字體變形,900 對(duì)應(yīng)最粗的字體變形。
數(shù)字 400 等價(jià)于 normal,而 700 等價(jià)于 bold。
posted on 2011-09-18 21:06 More study needed. 閱讀(7578) 評(píng)論(0) 收藏 舉報(bào)
浙公網(wǎng)安備 33010602011771號(hào)