agyanadda@gmail.com

CSS Lists

Styling Content 1 min read Updated Dec 1, 2026 Topic 27 of 39

List properties

  • list-style-type: disc, circle, square, decimal, upper-roman, none
  • list-style-position: outside (default) or inside
  • list-style-image: url("icon.png")
  • Shorthand: list-style: square inside;

Remove bullets

ul { list-style: none; padding: 0; margin: 0; } — the base for navigation menus.

Custom markers

li::marker { color: tomato; } colours the bullet or number.

Example

Example — Styled lists HTML
<style>
  .square { list-style-type: square; }
  .square li::marker { color: tomato; }
  .roman { list-style-type: upper-roman; }
  .menu { list-style: none; padding: 0; display: flex; gap: 10px; }
  .menu li { background: #1f386b; color: white; padding: 6px 12px; border-radius: 4px; }
</style>

<ul class="square"><li>HTML</li><li>CSS</li></ul>
<ol class="roman"><li>Step one</li><li>Step two</li></ol>
<ul class="menu"><li>Home</li><li>About</li><li>Contact</li></ul>

Test Yourself With Exercises

Exercise 1 Multiple Choice

Which value removes bullets?

Exercise 2 Fill in the Blank

li::___ styles the bullet or number of a list item.

Exercise 3 True / False

upper-roman shows numbers like I, II, III.

Frequently Asked Questions

Lists have default padding-left. Set padding: 0 on the ul or ol.