CSS | list-style-position Property
The list-style-position property in CSS specifies the position of the marker box with respect to the principal block box.
Syntax:
list-style-position: outside|inside|initial|inherit;
Values:
- outside: In this value the marker is outside the principal block box i.e the bullet points will be outside the list item. This is the default value.
- inside: In this value the marker is the first element among the list item’s contents i.e the bullet points will be inside the list item.
- initial: This mode sets this property to its default value.
Example:
<!DOCTYPE html> <html> <head> <title>CSS list-style-position Property</title> <style> .geek1 { list-style-position: outside; } .geek2 { list-style-position: inside; } </style> </head> <body> <h1 style = "text-align: center; color: green"> CSS list-style-position Property </h1> <h3>list-style-position: outside;</h3> <ul class="geek1"> <li>Bubble Sort </li> <li>Merge Sort</li> <li>Insertion Sort</li> </ul> <h3>list-style-position: inside;</h3> <ul class="geek2"> <li>Bubble Sort </li> <li>Merge Sort</li> <li>Insertion Sort</li> </ul> </body> </html> |
chevron_right
filter_none
Output:

Supported Browsers: The browser supported by list-style-position property are listed below:
- Apple Safari 1.0
- Google Chrome 1.0
- Firefox 1.0
- Opera 7.0
- Internet Explorer 4.0
Recommended Posts:
- HTML | DOM Style listStylePosition Property
- CSS | transition-property Property
- CSS | all Property
- CSS | right Property
- CSS | top Property
- CSS | align-self Property
- CSS | resize Property
- CSS | grid-row-gap Property
- CSS | padding-top Property
- CSS | grid-row Property
- CSS | order property
- CSS | clear Property
- HTML | DOM specified Property
- CSS | quotes Property
- CSS | Display property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



