em:字體的高度,相對(duì)長(zhǎng)度單位。相對(duì)于當(dāng)前對(duì)象內(nèi)文本的字體尺寸。如當(dāng)前對(duì)行內(nèi)文本的字體尺寸未被人為設(shè)置,則相對(duì)于瀏覽器的默認(rèn)字體尺寸(16px)。
ex(x-高度):CSS2規(guī)范將它描述為小寫(xiě)字母x的高度。
px(像素):它與背景或屏幕的分辨率有關(guān)。根據(jù)顯示器分辨率輸出不同像素,由于用戶的喜好不同,顯示器的分辨率可能會(huì)有很大差異。
in(英寸)
cm(厘米)
mm(毫米)
pt(點(diǎn),1點(diǎn)=1/72英寸)
pc(12點(diǎn)活字,1pc=12點(diǎn))
<html>
<head>
<title>FontSizing-equalvalues</title>
</head>
<body>
<pstyle=”font-size:36pt;”>Point</p>
<pstyle=”font-size:3pc;”>Pica</p>
<pstyle=”font-size:0.5in;”>Inches</p>
<pstyle=”font-size:1.27cm;”>Centimeters</p>
<pstyle=”font-size:12.7mm;”>Millimeters</p>
<pstyle=”font-size:300%;”>Percentage</p>
</body>
</html>
所有都與外觀有關(guān)
<html>
<head>
<title>DisplayTest</title>
<styletype=”text/css”>
body{font:SansSerif,Arial;font-size:110%}
</style>
</head>
<body>
<pstyle=”font-size:1.0em;”>Basictext.</p>
<pstyle=”font-size:1.5em;”>Largertext.</p>
<pstyle=”font-size:0.5em;”>smallertext.</p>
</body>
</html>
新聞熱點(diǎn)
疑難解答
圖片精選