list-style-position
Description
list-style-position
property sets the position of the list marker with respect to the content of the list item.
Item | Value |
---|---|
Initial value | outside |
Inherited | Yes. |
Version | CSS1 |
JavaScript syntax | object.style.listStylePosition="inside" |
Applies to | Elements whose display value is list-item. |
Syntax and Property Values
list-style-position: inside | outside | inherit
The property values are listed in the following table.
Value | Description |
---|---|
inside | The bullets stay inside the content flow |
outside | The bullets stay outside the content flow. Default value. |
inherit | Inherit the list-style-position property from the parent element |
Example
<!DOCTYPE HTML>
<html>
<head>
<style>
ul {<!-- ww w .java 2 s. c o m-->
font-family: sans-serif;
list-style-position: outside;
}
li {
border: thin solid lightgrey;
}
</style>
</head>
<body>
<ul>
<li>D</li>
<li>D</li>
<li>D</li>
</ul>
</body>
</html>
The code above generates the following result.