CSS3: customize numbered and nested lists

CSS

CSS3 allows you to fully customize the display of your lists. You will create really nice lists for your websites!

Defining the list bullet type

How to use them?

Remember in the HTML5 section with the ol, li, ul tags, you learned about numbered lists and nested lists. You know that CSS allows you to customize them. Simply use the CSS property list-style-type: disc for a filled circle, circle for an empty circle, and square for a square.

Examples:

.txt1 { list-style-type: disc; }

.txt2 { list-style-type: circle; }

.txt3 { list-style-type: square; }
Different types of bullets in CSS3
Différents types de puces en CSS 3

You can display numbers 1, 2, 3, 4, and also zero-padded numbers: 01, 02, 03, 04, or even Roman numerals in uppercase or lowercase with respectively:

.txt4 { list-style-type: decimal; }

.txt5 { list-style-type: decimal-leading-zero; }

.txt6 { list-style-type: upper-roman; }

.txt7 { list-style-type: lower-roman; }
CSS3: Decimal and Roman numeral bullets
CSS 3 : Puces au format décimal et romain

You can also use the alphabet with lists A, B, C, etc. or a, b, c, etc. with respectively:

.txt8 { list-style-type: upper-alpha; }

.txt9 { list-style-type: lower-alpha; }
CSS3 - Bullets with the alphabet
CSS 3 – Puces avec l’alphabet

You have multiple predefined options with CSS to customize the numbering of your lists, or the bullets corresponding to your lists. You can use them easily as in the following example:

<ul>
  <li class="txt1">Filled disc</li>
  <li class="txt2">Circle</li>
  <li class="txt3">Square</li>
  <li class="txt4">Decimal</li>
  <li class="txt5">Decimal</li>
</ul>

Choosing an image for the bullet

You can also define an image for a bullet. This means you can use a small logo to represent your bullet, an image in PNG, JPEG, or GIF format, as you wish.

You use the list-style-image property by providing the URL, either the full URL with the domain name, or directly the image file, depending on how you have organized your website.

Example:

ul { list-style-image: url('puce.gif'); }

With the example above, the image puce.gif will be used for all your bullets under the ul tag. You can declare your lists as in the example:

<ul>
  <li>An item</li>
  <li>Another item</li>
</ul>

The indentation option

You can also define the indentation of your list relative to other elements with list-style-position. outside is the default value, or inside as the alternative value.

.txt10 { list-style-position: outside; }

.txt20 { list-style-position: inside; }

outside: this is the classic presentation of bullet lists, where all bullets are aligned in the same way. Conversely, the inside value allows you to indent only the first bullet; the others will be aligned with the default marker.

Conclusion

Customize your website to the fullest with CSS. This article showed you how your lists can use basic elements (small circles, etc.) but also any element you define yourself (bullets displayed with your own images).


There you go, now you can shine at parties…

We have put some courses on sale on the Itamde web school: online courses

You can also find us on YouTube:

Ici => https://www.youtube.com/channel/UCZ4dhshzpVbbRPVuL9TNH4Q

Ou ici => https://www.youtube.com/channel/UCQlKs3ToaL8IKRbXtwtFnyA

Recent Posts

Recent Comments

Itamde is also an online programming school.

Itamde

Learn what you want, at your own pace

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

You may also be interested in…

Artificial intelligence is reshaping every pixel

Artificial intelligence is reshaping every pixel

Just a few years ago, editing a photo meant spending hours working meticulously in Photoshop, mastering layers, masks and curves. In 2026, everything has shifted. AI photo editing tools no longer settle for automatic filters — they understand image content, anticipate...

The 10 Best Free AI Tools for Developers in 2026

The 10 Best Free AI Tools for Developers in 2026

Artificial intelligence is transforming how developers write, test, and deploy code. In 2026, many AI tools are freely accessible, offering capabilities that would have seemed impossible just a few years ago. Whether you're a beginner or experienced developer, these...

CSS colors

CSS colors

CSS colors can be defined in hexadecimal. Hexadecimal uses three components: red, green, and blue. You can define colors in shorthand hexadecimal: for example #DC2 corresponds to #DDCC22. Note that some colors cannot be abbreviated. The goal is to shorten your...

Stay up to date with the latest news and developments

Access restricted content

Discover behind-the-scenes details of our projects, exclusive resources, and the progress of our creations in real time.

Sign up for our newsletter

Receive our news, creative insights, and updates from the studio directly in your inbox.

Follow us

Join our community on social media to follow our daily projects and interact with us.