Style listStylePosition Attribute
- Halaman sebelumnya listStyleImage
- Halaman berikutnya listStyleType
- Kembali ke lapisan atas Objek Style HTML DOM
Definition and Usage
listStylePosition
Sets or returns the position of the list item marker.
See Also:
CSS Tutorial:Senarai CSS
CSS Reference Manual:list-style-position Attribute
HTML DOM Reference Manual:listStyle Attribute
Instance
Example 1
Indent the list item marker:
document.getElementById("myUL").style.listStylePosition = "inside";
Example 2
Return the position of the list item marker:
alert(document.getElementById("myList").style.listStylePosition);
Syntax
Return the listStylePosition attribute:
object.style.listStylePosition
Set the listStylePosition attribute:
object.style.listStylePosition = "outside|inside|initial|inherit"
Attribute Value
Value | Description |
---|---|
outside | The list item marker will be presented before any text content. Default. |
inside | Indent the list item marker. |
initial | Sets this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Technical Details
Default value: | outside |
---|---|
Return value: | A string that represents the position of the list item marker. |
CSS Version: | CSS1 |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Dukungan | Dukungan | Dukungan | Dukungan | Dukungan |
- Halaman sebelumnya listStyleImage
- Halaman berikutnya listStyleType
- Kembali ke lapisan atas Objek Style HTML DOM