English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules

Complete List of CSS Properties

CSS list-style-Usage and Examples of position Attribute

list-style-The position CSS attribute specifies the position of the list item marker relative to the main block box of the list item.

The following table provides usage instructions and version history of this attribute, as well as its usage syntax in JavaScript scripts.

Default Value:outside
Applies To:List Item
Inheritance:Yes
Animatable:No.Please see Animation Attributes.
Version:CSS 1,2,3
JavaScript Syntax:object.style.listStylePosition="inside"

Syntax of Using List Style Position

The syntax of this attribute is as follows:

list-style-position: inside | outside | initial | inherit

The following examples demonstrate how to use list-style-position Attribute.

  ol {
   list-style-position: inside;
  }
  ul {
   list-style-position: outside;
  }
Test and see‹/›

Attribute Values

The following table describes the values of this attribute.

ValueDescription
insideList markers are placed in the first inline box within the main block box, before the element content.
outsideList markers are placed outside the main block box. This is the default value.
initialSet this attribute to its default value.
inheritIf specified, the associated elements adopt the parent element's list-style-position Attribute Values.

Browser Compatibility

list-style-Browser Compatibility of position Attribute, the numbers in the following table represent the minimum version number of browsers that support this attribute; all mainstream browsers support this attribute.

  • Firefox 1+

  • Google Chrome1+

  • Internet Explorer 4+

  • Apple Safari 1+

  • Opera 4+

Further Reading

Please refer to the following tutorial:HTML List,CSS List.

Related Attributes:list-style,list-style-image,list-style-type.