The list-style-position property specifies where the list item marker is placed.
ul {
list-style-position: outside;
}
ol {
list-style-position: inside;
}
| Property | Value | Explanation |
|---|---|---|
| list-style-position | outside | the marker is placed outside the list item (default) |
| inside | the marker is placed inside the list item |
<html> <head> <title>TAG index</title> <style type="text/css"> #example1 { list-style-position: outside; } #example2 { list-style-position: inside; } </style> </head> <body> <ul id="example1"> <li>First list item<br>The marker is placed outside</li> <li>Second list item<br>The marker is placed outside</li> <li>Third list item<br>The marker is placed outside</li> </ul> <ul id="example2"> <li>First list item<br>The marker is placed inside</li> <li>Second list item<br>The marker is placed inside</li> <li>Third list item<br>The marker is placed inside</li> </ul> </body> </html>