fervor [>]CODING & CURIOSITY
FERVOR LEARNING SYSTEMTUTORIALS
← CSS

CSS / 5 MIN READ

Change Bullet Color

Learn how to change the color of list bullets in CSS.

From the original Fervor library. Examples may use older package versions.

🎨 How to Change the Color of Bullets in an <li> Using CSS

By default, the bullets in a <ul> (unordered list) take on the text color of the list items (<li>). But what if you want the bullets to have a different color than the text? CSS has got you covered! Let’s go step by step.


πŸ› οΈ Method 1: Using ::marker (The Best & Easiest Way 🎯)

CSS introduced the ::marker pseudo-element, which specifically targets the bullet (or number in an ordered list).

βœ… Example:

ul li::marker {
  color: red; /* Change bullet color */
  font-size: 1.5em; /* Make the bullet bigger */
}
<ul>
  <li>Apple</li>
  <li>Banana</li>
  <li>Cherry</li>
</ul>

πŸ”Ή What happens? The bullets will turn red while the text remains its default color.

πŸ“Œ Bonus: You can also add custom styles to bullets, like changing their size or using Unicode characters!

ul li::marker {
  color: blue;
  content: "πŸ”₯ "; /* Custom bullet */
}

πŸ› οΈ Method 2: Using list-style-image (For Fancy Custom Bullets πŸ–ΌοΈ)

If you want to replace the bullet with an image, you can use list-style-image.

βœ… Example:

ul {
  list-style-image: url('bullet.png'); /* Replace with your image */
}

πŸ“Œ Downside: This method can be a bit outdated and doesn’t allow color changes directlyβ€”just image replacements.


πŸ› οΈ Method 3: Using list-style-type + ::before (More Customization 🎨)

For even more control, use ::before with content to manually create bullets.

βœ… Example:

ul {
  list-style-type: none; /* Remove default bullets */
}

ul li::before {
  content: "β€’"; /* Custom bullet */
  color: green; /* Change bullet color */
  font-size: 1.2em; /* Adjust size */
  margin-right: 8px;
}
<ul>
  <li>Dog</li>
  <li>Cat</li>
  <li>Rabbit</li>
</ul>

πŸ”Ή Why use this? It gives full styling control over the bullet’s appearance, including font, size, spacing, and color.


πŸš€ Which Method Should You Use?

Method Best For Notes
::marker Simple bullet color change Best for modern browsers βœ…
list-style-image Using custom images as bullets Might not work well in all cases ⚠️
::before Full control over bullet styles Works even in older browsers πŸ’‘

🎯 Conclusion

If you just want to change the bullet color, go with ::marker.
If you want full customization, ::before is your best bet.

πŸŽ‰ Fun & Creative Things to Do with List Bullets in CSS!

Now that we know how to style bullets, let’s get creative! Here are some cool and fun ways to customize bullets using CSS.


1️⃣ Emoji Bullets for a Fun Touch πŸ˜ƒ

Who said bullets have to be boring dots? Replace them with emojis!

🎨 CSS:

ul {
  list-style-type: none; /* Remove default bullets */
}

ul li::before {
  content: "⭐"; /* Star emoji as bullet */
  color: gold;
  font-size: 1.2em;
  margin-right: 8px;
}

🌟 Output:

⭐ Item 1
⭐ Item 2
⭐ Item 3

πŸ”Ή Try different emojis:

  • βœ… "βœ…" for checklists
  • πŸ”₯ "πŸ”₯" for a hot list
  • πŸ₯‡ "πŸ₯‡" for ranking lists

2️⃣ Gradient Bullets for a Fancy Look 🌈

Want bullets that change colors? Try a gradient effect!

🎨 CSS:

ul li::marker {
  color: linear-gradient(to right, red, blue); /* Won't work directly */
}

πŸ“Œ Why? ::marker doesn’t support gradients, but you can fake it:

ul {
  list-style-type: none;
}

ul li::before {
  content: "⬀";
  background: linear-gradient(to right, red, blue);
  -webkit-background-clip: text;
  color: transparent;
  font-size: 1.5em;
  margin-right: 8px;
}

🎨 Result: A smooth gradient effect on bullets!


3️⃣ Make Bullets Rotate on Hover πŸ”„

Make your bullets spin when hovered over for a cool effect!

🎨 CSS:

ul {
  list-style-type: none;
}

ul li::before {
  content: "πŸ”΅"; /* Use any symbol */
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.3s ease-in-out;
}

ul li:hover::before {
  transform: rotate(360deg);
}

πŸ”„ Result: Hover over an item, and the bullet spins!


4️⃣ Animating Bullets with a Bouncy Effect 🎾

Make bullets bounce when you hover!

🎨 CSS:

ul {
  list-style-type: none;
}

ul li::before {
  content: "πŸ”Ή";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.3s ease-in-out;
}

ul li:hover::before {
  transform: translateY(-5px);
}

🎾 Result: The bullets will β€œjump” when you hover!


5️⃣ Using CSS Counters for Auto-Numbered Lists πŸ”’

Want a numbered list but with custom styling? Use CSS counters!

🎨 CSS:

ul {
  list-style-type: none;
  counter-reset: my-counter;
}

ul li {
  counter-increment: my-counter;
}

ul li::before {
  content: counter(my-counter) ". ";
  color: red;
  font-weight: bold;
}

πŸ”’ Result:

  1. First item
  2. Second item
  3. Third item

6️⃣ Changing Bullet Shapes Dynamically πŸŸ‘πŸ”ΌπŸ”·

Make each bullet a different shape!

🎨 CSS:

ul {
  list-style-type: none;
}

ul li:nth-child(1)::before {
  content: "πŸ”΄"; /* Circle */
}

ul li:nth-child(2)::before {
  content: "πŸ”Ί"; /* Triangle */
}

ul li:nth-child(3)::before {
  content: "πŸ”·"; /* Diamond */
}

🟠 Result:
πŸ”΄ First item
πŸ”Ί Second item
πŸ”· Third item


🎯 Final Thoughts

Who knew list bullets could be so much fun? πŸ˜†
Try these out and let me know which one is your favorite! πŸš€

Keep your curiosity going.Explore more CSS β†’
287 TUTORIALS Β· 22 TOPICSREADY