Revised: Jun./26th/2004
CSS2 では、要素が二つのボックスを生成する機構を持っています。一つは要素の内容を含む基本ブロックボックスと呼ばれ、もう一つはリストなどの記号や番号などの装飾を含む分離マーカボックスと呼ばれます。
マーカーは、'display: marker
' の要素に対して、基本ボックスの外側に、行ボックスとして生成されます。このボックスはパッディングとボーダーを持ちますが、マージンがありません。マージンに類する指定は、'list-style-position
' と 'marker-offset
' で指定します。
marker-offset
プロパティ 'marker-offset
' は、'display: marker
' の要素に指定可能です。'display: marker
' は、擬似要素 :before
か :after
をセレクタとして指定し、それ以外のセレクタに対しては、'display: inline
' と等価になります。セレクタにマッチした対象のマーカボックスと基本ボックスの距離を指定します。
プロパティ名 | 値 |
---|---|
marker-offset | <length> | auto | inherit |
'marker-offset
' は子要素に継承されません。デフォルトの値は auto
です。inherit
は、親要素の値を明示的に継承する指定です。
'marker-offset
' の例:
/* li 要素のマーカから基本ボックスまでの距離を 2em */ li:before { display: marker; marker-offset: 2em }
<ul> <li style="marker-offset: 1em">list-item. offset 1em</li> <li style="marker-offset: 2em">list-item. offset 2em</li> </ul>
list-style-type
プロパティ 'list-style-type
' は、'display: list-item
' の要素に指定可能です。セレクタにマッチした対象のマーカボックスと基本ボックスの距離を指定します。
プロパティ名 | 値 |
---|---|
list-style-type | disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-alpha | lower-latin | upper-alpha | upper-latin | hebrew | armenian | georgian | cjk-ideographic | hiragana | katakana | hiragana-iroha | katakana-iroha | none | inherit |
'list-style-type
' は子要素に継承されます。デフォルトの値は disc
です。inherit
は、親要素の値を明示的に継承する指定です。
'list-style-type
' の例:
ul { list-style-tyupe: disc } ul ul { list-style-tyupe: circle } ul ul ul { list-style-tyupe: square }
disc: 黒丸
circle: 丸
square: 四角
decimal: 1,2,3,4,...
decimal-leading-zero: 01,02,03,04,...
lower-roman: i,ii,iii,iv,v,...
upper-roman: I,II,III,IV,V,...
hebrew: ヘブライ数字。,
,
,
,
,
,
,
,
,
,...
georgian: グルジア数字。,
,
,
,
,
,
,
,
,
,...
armenian: アルメニア数字。,
,
,
,
,
,
,
,
,
,...
cjk-ideographic: 漢数字 (CJK=Chinese, Japanese, Korean)
hiragana: あ,い,う,え,...
katakana: ア,イ,ウ,エ,...
hiragana-iroha: い,ろ,は,に,...
katakana-iroha: イ,ロ,ハ,ニ,...
lower-latin: a,b,c,d,...
lower-alpha: lower-latin と同じ
upper-latin: A,B,C,D,...
upper-alpha: upper-latin と同じ
lower-greek: 小文字ギリシャ文字。α,β,γ,δ,ε,ζ,η,&theta,...
ヘブライ | アルメニア | グルジア |
---|---|---|
ol { font-family: serif; dislilay: list-item; list-style-type: hebrew } |
ol { font-family: serif; dislilay: list-item; list-style-type: armenian } |
ol { font-family: serif; dislilay: list-item; list-style-type: georgian } |
|
|
|
list-style-image
プロパティ 'list-style-image
' は、'display: list-item
' の要素に指定可能です。セレクタにマッチした対象のマーカボックスのマーカに使用する画像を指定します。
プロパティ名 | 値 |
---|---|
list-style-image | <uri> | none | inherit |
'list-style-image
' は子要素に継承されます。デフォルトの値は none
です。inherit
は、親要素の値を明示的に継承する指定です。
画像が使用できれば、'list-style-type
' で指定されたマーカを置換します。画像が使用できない場合に備えて、'list-style-image
' と同時に指定することが望ましいでしょう。
'list-style-image
' の例:
ul { list-style-type: disc; list-style-image: url(./disc.png) }
後で紹介する省略プロパティ 'list-style
' を使うと、次のように指定できます。
ul { list-style: url(./disc.png) disc }
list-style-position
プロパティ 'list-style-position
' は、'display: list-item
' の要素に指定可能です。セレクタにマッチした対象のマーカボックスの基本ボックスに対する位置を指定します。
プロパティ名 | 値 |
---|---|
list-style-position | inside | outside | inherit |
'list-style-position
' は子要素に継承されます。デフォルトの値は outside
です。inherit
は、親要素の値を明示的に継承する指定です。
outside
display: maeker
' である要素の 'marker-offset
' で指定する。inside
'list-style-position
' の例:
ol { list-style-position: inside }
list-style
プロパティ 'list-style
' は、'display: list-item
' の要素に指定可能です。セレクタにマッチした対象の、リスト関係の省略プロパティを指定します。
プロパティ名 | 値 |
---|---|
list-style | [ <'list-style-type'> || <'list-style-position'> || <'list-style-image'> ] | inherit |
'list-style
' は子要素に継承されます。デフォルトの値は未定義です。inherit
は、親要素の値を明示的に継承する指定です。
'list-style
' の例:
/* 画像 "./eclipse.png" 又は disc を使用 */ ul { list-style: url(./eclipse.png) disc }Copyright © 2004 SUGAI, Manabu. All rights reserved.