Specify an image as the list-item marker in a list:
document.getElementById("myList").style.listStyleImage = "url('sqorange.gif')";
Try it Yourself »
The listStyleImage property sets or returns an image as the list-item marker.
Property | |||||
---|---|---|---|---|---|
listStyleImage | Yes | Yes | Yes | Yes | Yes |
Return the listStyleImage property:
object.style.listStyleImage
Set the listStyleImage property:
object.style.listStyleImage = "none|
url|initial|inherit"
Value | Description |
---|---|
none | No image will be displayed. This is default |
url | Specifies the path to the image |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | none |
---|---|
Return Value: | A String, representing the location path of the image |
CSS Version | CSS1 |
Return the list-style-image property value:
alert(document.getElementById("myList").style.listStyleImage);
Try it Yourself »
CSS tutorial: CSS List
CSS reference: list-style-image property
HTML DOM reference: listStyle property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!