home > 『Web標準の教科書』読者サポートページ > 第3章 第3節
第3章 第3節(p.119-124)
<p style="margin: 15px">
<style type="text/css">
p { margin: 15px }
</style>
<link rel="stylesheet" type="text/css" href="./css/default.css" />
<style type="text/css">
@import url("./css/default.css")
</style>
<?xml-stylesheet type="text/css" href="./css/default.css"?>
<meta http-equiv="Content-Style-Type" content="text/css" />
Header append Content-Style-Type "text/css"
<link rel="stylesheet" type="text/css" href="./css/default.css" />
<style type="text/css">
@import url("./css/special.css");
p.attn { color: purple }
</style>
:
:
<p class="attn" style="color: red">注意文</p>
p.attn { color: purple }
p.note { color: red }
:
:
<p class="atte note">注意文</p>
* {} /* a=0, b=0, c=0, 個別性 = 0 */
ul {} /* a=0, b=0, c=1, 個別性 = 1 */
ul + ol {} /* a=0, b=0, c=2, 個別性 = 2 */
ul + ol li {} /* a=0, b=0, c=3, 個別性 = 3 */
li[class="num"] {} /* a=0, b=1, c=1, 個別性 = 11 */
ul + ol li.num {} /* a=0, b=1, c=3, 個別性 = 13 */
li.num.com {} /* a=0, b=2, c=1, 個別性 = 21 */
#get {} /* a=1, b=0, c=0, 個別性 = 100 */
p#attn {} /* a=1, b=0, c=1, 個別性 = 101 */
p { color: black }
p.attn { color: red }
p#attn1 { color: purple }
:
:
<p class="attn" id="attn1">注意文</p>
#get { color: blue }
:
:
<p id="get" style="color: green">テキスト</p>
作成者スタイル > ユーザースタイル > ブラウザスタイル
!important宣言つきユーザースタイル > !important宣言つき作成者スタイル
> 作成者スタイル > ユーザースタイル > ブラウザスタイル