listStyleImage style property
Specifies or returns a graphic image for a list label.
When the image is available, it will replace the marker set with the 'list-style-type' marker.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: list-style-image |
Possible values:
The type of this property is string.
One of the following values:
Where URI specifies the location of an image file. | |||||||
Takes the value of this property from the computed style of the parent element. | |||||||
Default. No external list-marker is specified. |
Default: none.
Example HTML code 1:
This example illustrates the use of the list-style-image property:
|
||||
<head> <style> .example { list-style-image: url("listImage.png"); } </style> </head> <body> <ol class="example"> <li>Apple <li>Pear <li>Peach </ol> </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the listStyleImage property in JavaScript:
|
||||
<head> <style> .example { list-style-image: url("listImage.png"); } </style> <script type="text/javascript"> function SetImage () { var oList = document.getElementById ("myOList"); oList.style.listStyleImage = 'url("listImage.png")'; } function RemoveImage () { var oList = document.getElementById ("myOList"); oList.style.listStyleImage = "none"; } </script> </head> <body> <ol class="example" id="myOList"> <li>Apple <li>Pear <li>Peach </ol> <button onclick="RemoveImage ();">Remove image!</button> <button onclick="SetImage ();">Set image!</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
list-style-image (MSDN)
list-style-image (Mozilla Developer Center)
list-style-image (Safari Reference Library)
list-style-image (W3C)
list-style-image (Mozilla Developer Center)
list-style-image (Safari Reference Library)
list-style-image (W3C)
User Contributed Comments