CSS Attributes Index Classification Attributes
Sets or retrieves how the list-item marker is drawn in relation to the object’s content.
CSS |
{ list-style-position: 'outside' | 'inside' } |
Script |
object.style.listStylePosition = sPosition ] |
outside |
The marker is placed outside the text ( any wrapping text is not aligned under the marker ). |
inside |
The marker is placed inside the text ( any wrapping text is aligned under the marker ). |
The property is read/write with a default value of outside; the CSS attribute is inherited.
This property is applicable only on objects with a display value of list-item.
If the left margin of a list item is set to 0 using one of the margin properties, the list-item markers will not show. The margin should be set to a minimum of 30 points.
The following example demonstrates the effects of applying the different values possible for the CSS list-style-position attribute. This feature requires Microsoft® Internet Explorer® 4.0 or later.
<ul style="list-style-position: inside">
<li>this is the first item in the list
<li>and this is the second list item
</ul>
Show me
The sample below uses inline event handlers to dynamically set an object’s listStylePosition in response to mouse events.
<ul onmouseover="this.style.listStylePosition='inside'"
onmouseout="this.style.listStylePosition=''">
,,,
</ul>
This feature requires Microsoft® Internet Explorer® 4.0 or later.
Show me
currentStyle, LI, OL, runtimeStyle, style, UL
list-style, list-style-image, list-style-type