CSSlist -style-positionプロパティ
例
リストアイテムマーカーの位置を指定します。
ul.a {
list-style-position: outside;
}
ul.b {
list-style-position: inside;
}
定義と使用法
このlist-style-position
プロパティは、リストアイテムマーカー(箇条書き)の位置を指定します。
list-style-position: outside;
箇条書きがリスト項目の外にあることを意味します。リストアイテムの各行の先頭は垂直方向に配置されます。
- コーヒー- 焙煎したコーヒー豆から作られた淹れたての飲み物...
- お茶
- コークス
list-style-position: inside;
箇条書きがリストアイテム内にあることを意味します。これはリストアイテムの一部であるため、テキストの一部になり、最初にテキストをプッシュします。
- コーヒー- 焙煎したコーヒー豆から作られた淹れたての飲み物...
- お茶
- コークス
デフォルト値: | 外 |
---|---|
遺伝性の: | はい |
アニメート可能: | 番号。アニメート可能について読む |
バージョン: | CSS1 |
JavaScript構文: | object .style.listStylePosition = "inside" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
list-style-position | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
CSS構文
list-style-position: inside|outside|initial|inherit;
プロパティ値
Value | Description | Play it |
---|---|---|
inside | The bullet points will be inside the list item | |
outside | The bullet points will be outside the list item. This is default | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
関連ページ
CSSチュートリアル:CSSリスト
CSSリファレンス:リストスタイルのプロパティ
HTML DOMリファレンス:listStylePositionプロパティ