CSS Styling Lists
CSS List Style Type
There are two types of lists:
- Unordered lists
- Ordered lists.
Unordered list styles: disc (default), square, circle or none.
Ordered list styles: decimal (default), upper-alpha, lower-alpha, upper-roman, lower-roman or none.
Example:
ol { list-style-type: upper-alpha; } ul { list-style-type: square; }
Result:
- CSS
- Ordered
- List
- Example
unordered list:
- CSS
- UnOrdered
- List
- Example
CSS List Style Position
There is a possibility to set the list markers position to outside (default) or inside the content flow.
Example:
ul.i { list-style-position: inside; } ul.o { list-style-position: outside; }
Result:
- CSS
- List
- Style position
- Inside
outside:
- CSS
- List
- Style position
- Outside
CSS List Style Image
The list-style-image property is used to set an image as the list item marker.
Example:
ol { list-style-image: url('example.gif'); } ul { list-style-image: url('example_2.gif'); }
Result:
- CSS
- List
- Style
- With images
Unsorted:
- CSS
- List
- Style
- With images
Another example:
ul { list-style: square url('not_exist.gif'); }
Result:
- If the image does not exist, then displayed square markers
Previous page: CSS Links Styling
Next page: CSS Cursor Styling