CSS Tutorials

Overview

In HTML, there are two main types of lists: unordered lists <ul>, which use bullets for each list item and ordered lists <ol>, which use a numbering system.

<ul type="square">
    <li>Maserati</li>
    <li>Alfa Romeo</li>
    <li>Ferrari</li>
</ul>
<ol type="1">
    <li>Maserati</li>
    <li>Alfa Romeo</li>
    <li>Ferrari</li>
</ol>

HTML has limitations to styling a list (or anything really), so CSS is best used for styling the lists.

Note

The following are basic examples. Towards the bottom of this page you’ll find a complete list of all applicable properties, where you can find more information on the properties discussed, and sometimes find more involved properties not discussed on this page.

Changing a Lists Bullets/Numbers with CSS

As with any HTML element, the lists can be styled to change the text color, font, spacing, etc. But lists also use bullets and numbers to differentiate their list items. And using CSS we are given a wider variety of changing the bullets, including using images, or even removing them altogether.

Using bullets and numbers:

ul {
    list-style-type: square;
}
ol {
    list-style-type: upper-roman;
}
ValueDescription
discThe marker is a filled circle (default on unordered lists)
armenianThe marker is traditional Armenian numbering
circleThe marker is a circle
cjk-ideographicThe marker is plain ideographic numbers
decimalThe marker is a number (default on ordered lists)
decimal-leading-zeroThe marker is a number with leading zeros (01, 02, 03, etc.)
georgianThe marker is traditional Georgian numbering
hebrewThe marker is traditional Hebrew numbering
hiraganaThe marker is traditional Hiragana numbering
hiragana-irohaThe marker is traditional Hiragana iroha numbering
katakanaThe marker is traditional Katakana numbering
katakana-irohaThe marker is traditional Katakana iroha numbering
lower-alphaThe marker is lower-alpha (a, b, c, d, e, etc.)
lower-greekThe marker is lower-greek
lower-latinThe marker is lower-latin (a, b, c, d, e, etc.)
lower-romanThe marker is lower-roman (i, ii, iii, iv, v, etc.)
noneNo marker is shown
squareThe marker is a square
upper-alphaThe marker is upper-alpha (A, B, C, D, E, etc.)
upper-greekThe marker is upper-greek
upper-latinThe marker is upper-latin (A, B, C, D, E, etc.)
upper-romanThe marker is upper-roman (I, II, III, IV, V, etc.)
initialSets this property to its default value
inheritInherits this property from its parent element

Using Images:

ul {
    list-style-image: url("my_marker.jpg");
}

Removing Bullets and Indentation

This keeps the list structure, but does away with the list look.

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

List Properties


CSS Notes:


We’d like to acknowledge that we learned a great deal of our coding from W3Schools and TutorialsPoint, borrowing heavily from their teaching process and excellent code examples. We highly recommend both sites to deepen your experience, and further your coding journey. We’re just hitting the basics here at 1SMARTchicken.