Indent the list-item marker:
document.getElementById("myUL").style.listStylePosition = "inside";
Try it Yourself »
The listStylePosition property sets or returns the position of the list-item marker.
Property | |||||
---|---|---|---|---|---|
listStylePosition | Yes | Yes | Yes | Yes | Yes |
Return the listStylePosition property:
object.style.listStylePosition
Set the listStylePosition property:
object.style.listStylePosition = "outside|inside|initial|inherit"
Value | Description |
---|---|
outside | The list-item marker will be rendered before any text content. This is default |
inside | Indents the list-item marker marker |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | outside |
---|---|
Return Value: | A String, representing the position of the list-item marker |
CSS Version | CSS1 |
Return the position of the list-item marker:
alert(document.getElementById("myList").style.listStylePosition);
Try it Yourself »
CSS tutorial: CSS List
CSS reference: list-style-position property
HTML DOM reference: listStyle property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!