Click to return to the DHTML, HTML     
list-style attribute | li...     list-style-position Attri...     DHTML Properties    
Web Workshop  |  DHTML, HTML & CSS

list-style-image Attribute | listStyleImage Property


Sets or retrieves which image to use as a list-item marker for the object.

Syntax

HTML{ list-style-image: sLocation }
Scriptingobject.style.listStyleImage [ = sLocation ]

Possible Values

sLocation String that specifies one of the following values:
noneNo image is specified.
url(sURL)Location of the image, where sURL is an absolute or relative URL.

The property is read/write with a default value of none; the cascading style sheets (CSS) attribute is inherited.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see Dynamic Properties.

Remarks

When the image is available, it replaces the marker that is set with the listStyleType marker.

If the left margin of the list item is set to 0 using one of the margin properties, the list-item markers do not show. The margin should be set to a minimum of 30 points.

Example

The following examples use the list-style-image attribute and the listStyleImage property to set the image for markers.

This example uses UL as a selector in an embedded (global) style sheet to set the marker to the dot.gif image.

Sample Code

<STYLE>
    UL { list-style-image:url(dot.gif) }
</STYLE>

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

This example uses inline scripting to change the style of the list-item marker to an image when an onmouseover event occurs.

<UL onmouseover="this.style.listStyleImage='url(dot.gif)'">

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
currentStyle, LI, OL, runtimeStyle, style, UL


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.