0 out of 4 rated this helpful - Rate this topic

list-style-type Attribute | listStyleType Property

Gets or sets the predefined type of the line-item marker for the object.

Syntax

CSS { list-style-type : sTypesType }
Scripting [ sTypesType = ] object.style.listStyleType

Possible Values

sType String that specifies or receives one of the following values.
lower-alpha
a, b, c, d, and so on.
upper-alpha
A, B, C, D, and so on.
lower-roman
i, ii, iii, iv, and so on.
upper-roman
I, II, III, IV, and so on.
lower-greek
Windows Internet Explorer 8. Lowercase classical Greek: alpha, beta, gamma, and so on.
lower-latin
Internet Explorer 8. a, b, c, d, and so on.
upper-latin
Internet Explorer 8. A, B, C, D, and so on.
armenian
Internet Explorer 8. Traditional Armenian numbering.
georgian
Internet Explorer 8. Traditional Georgian numbering: an, ban, gan, don, and so on.
none
No marker is shown.
sType String that specifies or receives one of the following values.
disc
Default. Solid circles.
circle
Outlined circles.
square
Solid squares.
decimal
1, 2, 3, 4, and so on.
decimal-leading-zero
Internet Explorer 8. 01, 02, 03, 04, and so on.

The property is read/write for all objects except the following, for which it is read-only: currentStyle. The property has a default value of disc. The Cascading Style Sheets (CSS) attribute is inherited.

DHTML expressions can be used in place of the preceding value(s). As of Internet Explorer 8, expressions are supported in IE7 Standards mode and IE5 (Quirks) mode only. For more information, see About Dynamic Properties and Defining Document Compatibility.

Remarks

The listStyleType property determines the appearance of the list-item marker if the value of the list-style-image attribute is set to none, or if the image pointed to by the URL cannot be displayed.

The listStyleType property can be applied to any element when margin and display: list-item are applied. The display: list-item property is available as of Microsoft Internet Explorer 6 and later.

If the left margin of a line 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.

Examples

The following examples use the list-style-type attribute and the listStyleType property to set the markers.

This example uses ul as a selector in an embedded (global) style sheet to change the marker type to circle.


<style>
    ul { list-style-type:circle }
</style>

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/list-style-type.htm

This example uses inline scripting to change the marker type on when an onmouseover event occurs.


<UL onmouseover="this.style.listStyleType='circle'">

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/listStyleType.htm

This example demonstrates the line-item markers.


<style type="text/css">
.decleadzero {
	list-style-type: decimal-leading-zero;
}
...
</style>
<body>
	<ol class="decleadzero">
		<li>This is the first item. </li>
		<li>This is the second item. </li>
		<li>This is the third item. </li>
	</ol>
    ...
</body>

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/list-style-type_ie8.htm

Standards Information

This property is defined in Cascading Style Sheets (CSS), Level 1 (CSS1).

Applies To

CSSStyleDeclaration, currentStyle, LI, OL, runtimeStyle, style, UL, CSSCurrentStyleDeclaration Constructor, CSSRuleStyleDeclaration Constructor, CSSStyleDeclaration Constructor
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ