</> Code Corner

CSS · CSS Tutorial · Lesson 18

CSS Lists

List markers, images and positions.

The CSS list properties allow you to set different list item markers, use images as markers and add colors.

Example

<style>
ul.a { list-style-type: circle; }
ul.b { list-style-type: square; color: #04AA6D; }
ol.c { list-style-type: upper-roman; }
ul.d { list-style: none; padding: 0; }
ul.d li { background: #f1f1f1; margin: 4px 0; padding: 8px; border-left: 4px solid #04AA6D; }
</style>
<ul class="a"><li>Coffee</li><li>Tea</li></ul>
<ul class="b"><li>Coffee</li><li>Tea</li></ul>
<ol class="c"><li>Coffee</li><li>Tea</li></ol>
<ul class="d"><li>Styled item</li><li>Another item</li></ul>
Property Use
list-style-type disc, circle, square, decimal, upper-roman, none…
list-style-image An image as the marker
list-style-position inside or outside
list-style Shorthand

Keep reading “CSS Lists”

Sign up to read the full lesson, try every example in the live editor, and take the 5-question quiz.

Chat with us 👋