danielhpavey.uk

Alternating Colour Bullet Points Using nth-child

I love bulleted lists for content. They're nice and easy for people to read and awesome in all kinds of ways!

A project I was working on had a very nice colour scheme and I wanted to incorporate the colours in lots of little design touches. An obvious route to go down was to colour the bullet in any lists.

I decided to use nth-child to colour every 3rd bullet differently. As you can't specify a bullets colour in CSS I was gonna have to build them with pseudo elements.

I've had a log of practice using pseudo elements, but am not hugely familiar with nth-child. This article on CSS Tricks was very helpful (as usual!).

Here's the code:

See the Pen Alternating Colour List Item Bullets by SpaceCadet9 (@spacecadet9) on CodePen.

Date: Thursday 19th March 2015