1.規則 selector {property : value}
(a) 選擇器-selector
(b) 屬性-property
(c) 值-value
2.example:
(a) 標準: body { color : black }
(b) 多字: p { font-family : "sans serif" }
(c) 多組(增加可讀性):
p {
text-align: center;
color: black;
font-family: arial;
}
3.CSS grouping:
(a) h1,h2,h3,h4,h5,h6 { color: green }
(b) p { font-family : "sans serif" , 標楷體 }
4.external style sheet
(a)獨立存檔
(b)不可含有html標籤
(c)副檔名為「.css」
(d)套用方式:(1) @import
(2) <link>
(e)在原網頁<head></head>裡面加入:
<link rel="stylesheet" type="text/css" href="外部css樣式檔案">
5.practice:"test.css" edited by notebook
body {background-color : yellow}
h1{font-size : 36pt}
h2{color : blue}
p{margin-left : 50px}