Style listStyleType 属性
- Page précédente listStylePosition
- Page suivante marge
- Retour au niveau supérieur Objet Style HTML DOM
定义和用法
listStyleType
属性设置或返回列表项标记类型。
另请参阅:
CSS 教程:Liste CSS
CSS 参考手册:list-style-type 属性
HTML DOM 参考手册:listStyle 属性
实例
例子 1
将列表项标记类型更改为 "upper-roman":
document.getElementById("myList").style.listStyleType = "upper-roman";
例子 2
所有不同的列表样式类型:
var listValue = selectTag.options[selectTag.selectedIndex].text; document.getElementById("myList").style.listStyleType = listValue;
Example 3
Return the type of list item marker:
alert(document.getElementById("myList").style.listStyleType);
Syntax
Return the listStyleType property:
object.style.listStyleType
Set the listStyleType property:
object.style.listStyleType = value
Attribute value
Value | Description |
---|---|
armenian | The label is in the traditional Armenian numbering. |
circle | The label is a circle. |
cjk-ideographic | The label is a simple ideographic number. |
decimal | The label is a number. This is the default value for <ol>. |
decimal-leading-zero | The label is a number with a leading zero (01, 02, 03, etc.). |
disc | The label is a solid circle. This is the default value for <ul>. |
georgian | The label is in the traditional Georgian numbering. |
hebrew | The label is in the traditional Hebrew numbering. |
hiragana | The label is in the traditional hiragana numbering. |
hiragana-iroha | The label is in the traditional hiragana iroha numbering. |
katakana | The label is in the traditional katakana numbering. |
katakana-iroha | The label is in the traditional katakana iroha numbering. |
lower-alpha | The label is in lowercase English letters (a, b, c, d, e, etc.). |
lower-greek | The label is in lowercase Greek letters. |
lower-latin | The label is in lowercase Latin letters (a, b, c, d, e, etc.). |
lower-roman | The label is in lowercase Roman numerals (i, ii, iii, iv, v, etc.). |
none | Do not display the label. |
square | The label is in a square. |
upper-alpha | The label is in uppercase English letters (A, B, C, D, E, etc.). |
upper-latin | The label is in uppercase Latin letters (A, B, C, D, E, etc.). |
upper-roman | The label is in uppercase Roman numerals (I, II, III, IV, V, etc.). |
initial | Set this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Détails techniques
Valeur par défaut : | <ul> est "disc", <ol> est "decimal". |
---|---|
Valeur de retour : | Chaîne de caractères, indiquant le type de liste. |
Version CSS : | CSS1 |
Navigateur pris en charge
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
- Page précédente listStylePosition
- Page suivante marge
- Retour au niveau supérieur Objet Style HTML DOM