CSS list-style-position property
Specify where the list item tags are in the list:
{
list-style-position:inside;
}
Try it out . . .
Description of property definition and use
The list-style-position property indicates how to draw a list item tag relative to the contents of the object.
Outside:
- Coffee
- Tea
- Coca-cola
Inside:
- Coffee
- Tea
- Coca-cola
Default: | outside |
---|---|
Inherited: | yes |
Version: | CSS1 |
JavaScript syntax: | object .style.listStylePosition="inside" |
Browser support
List-style-position properties are supported by all major browsers.
Note: I E7 and earlier versions do not support the value of "inherit". I E8 needs to be defined! D OCTYPE。 IE9 supports "inherit".
The property value
Value | Describe |
---|---|
inside | List item tags are placed within the text, and the surrounding text is aligned according to the tags. |
outside | The default. K eep the marker on the left side of the text. List item tags are placed outside the text, and the surrounding text is not aligned according to the tags. |
inherit | Specifies that the value of the list-style-position property should be inherited from the parent element. |
Related articles
CSS tutorial: CSS list
CSS Reference Manual: List-style properties