05_CSS長度單位
05_CSS長度單位
css file
/*針對DIV標籤下每個類別定義長度屬性
in - 英吋
cm - 公分
mm - 公釐
pt - 點, 1/72in
pc - 活字,12pt
px - 畫素
*/
div.in {
font-size: 1in;
}
div.cm {
font-size: 1cm;
}
div.mm {
font-size: 1mm;
}
div.pt {
font-size: 1pt;
}
div.pt {
font-size: 1pc;
}
div.px {
font-size: 1px;
}
|
html file
<html>
<head>
<title>網頁標題</title>
<link rel="stylesheet" type="text/css" href="01.css">
</head>
<body>
<div class="in">in: There is no spoon.</div>
<div class="cm">cm: There is no spoon.</div>
<div class="mm">mm: There is no spoon.</div>
<div class="pt">pt: There is no spoon.</div>
<div class="pc">pc: There is no spoon.</div>
<div class="px">px: There is no spoon.</div>
</body>
</html>
|