home > 『Web標準の教科書』読者サポートページ > 第3章 第2節
第3章 第2節(p.109-119)
セレクタ { プロパティ: 値 }
body { color: black }
body { color: black; font-size: large; }
body {
color: black;
background-color: white;
font-size: large;
line-height: 140%;
}
h1, h2, h3 { color: green }
abbr, acronym { border: 1px dashed gray }
[悪いソース]
BODY { color: black }
[よいソース]
body { color: black }
body
{
color
:
black;
font-size:
large;
}
[悪いソース]
body {
width: "auto";
border: "none";
font-family: "serif";
background: "red";
}
[よいソース]
body {
width: auto
border: none
font-family: serif;
background: red;
}
/* ページ全体に適用 */
body {
color: black;
background-color: white;
}
p { margin: 15px }
/* グローバルナビゲーションに適用 */
:
:
(略)
:
:
/* メインコンテンツに適用 */
:
:
(略)
:
:
blockquote { font-size: small } /* 引用文は小さめの文字 */
p { font-size: 12pt }
p { font-size: 1.2em }
body { color: #ff0000 }
body { color: #f00 }
body { color: rgb(255, 0, 0) }
body { color: rgb(100%, 0, 0) }
body { color: red }
body { background-image: url("../images/bcg.gif") }
body { background-image: url(../images/bcg.gif) }
p { font-size: 120% }
p.rightperson { azimuth: 90deg }
h2 { pause-before: 5s }
p.male { pitch: 120Hz }
p { color: red }
abbr { text-decoration: underline }
body { font-size: 90% }
p { font-size: 80% }
table { border: 1px solid gray }
td { border: inherit }