All Posts

How to style list markers in Tailwind CSS

You know those little bullets and numbers that show up before your list items? They might seem like tiny details, but trust me, they can completely transform how your lists look and feel.

I've been working with Tailwind CSS for years now, and one of my favorite features is how easy it makes styling these list markers. No more wrestling with complex CSS or adding extra markup – just clean, simple utility classes that get the job done.

Let me show you exactly how to customize list markers in Tailwind CSS and why you'll want to start using this technique in your projects.

What exactly are list markers?

Before we dive in, let's make sure we're on the same page. List markers are those bullets, numbers, or symbols that appear before each list item. You see them everywhere – in ordered lists (<ol>) they're usually numbers, and in unordered lists (<ul>) they're typically bullets.

Here's the cool part: Tailwind CSS gives you a marker: variant that directly targets these elements using the CSS ::marker pseudo-element. This means you can style the markers completely independently from your actual text content.

```html
  • Blue bullets catch attention
  • While text stays neutral
  • Clean and simple approach
```

Pretty neat, right? The marker gets the blue color while your text content stays exactly as you want it.

Changing colors and styles

Here's where things get interesting. The marker: variant works with most text-related utilities. You can change colors with marker:text-{color}, adjust sizes with marker:text-{size}, and even modify font weights with marker:font-{weight}.

Let me show you a few examples:

```html
  • Large red bullets for warnings
  • Really make important info stand out
  1. Bold green numbers
  2. Perfect for step-by-step instructions
```

This is exactly what you'll need when you want to create visual hierarchy without touching your actual content. Red markers might signal warnings or important notes, while green ones could indicate success steps or positive outcomes.

Getting creative with custom marker types

Don't worry – you're not stuck with just basic bullets and numbers! Tailwind lets you use custom marker types with the list-[value] syntax. This opens up some really cool possibilities.

```html
  • Square bullets look modern
  • Great for tech or design content
  1. Roman numerals add formality
  2. Perfect for academic or legal writing
  • Hollow circles for subtle emphasis
  • Less visual weight than solid bullets
```

Each marker type tells a different story. Square bullets feel modern and geometric – perfect for tech documentation. Roman numerals suggest formality and importance. Hollow circles provide gentle guidance without overwhelming your content.

Making markers interactive

Here's where it gets really fun! You can combine the marker: variant with hover states and other interactive variants. This creates engaging lists that actually respond to user interaction.

```html
  • Hover me to see both text and marker change
  • Interactive elements improve user engagement
  • You can even use different colors for variety
```

The smooth transition effect makes the whole experience feel polished and professional. This technique works great for navigation lists, feature highlights, or any content where you want to guide user attention naturally.

Using custom images as markers

For maximum customization, you can replace standard markers with custom images using the list-image-[url()] utility. This is perfect for brand icons, checkmarks, or any decorative elements that match your design.

```html
  • Feature included in Pro plan
  • Checkmarks suggest completion or approval
  • Perfect for feature lists and benefits
```

The example above uses an SVG checkmark encoded as a data URL. You can create your own icons or use external image files – just remember to keep them small and optimized so they don't slow down your page.

Building a real-world feature list

Let's put everything together and create something you'd actually use in a real project – a polished feature list that could appear on a landing page or product showcase.

```html

Why Choose Our Platform

  • Lightning-Fast Performance

    Our optimized infrastructure delivers content 3x faster than competitors, keeping your users engaged and coming back for more.

  • <li class="group">
      <h3 class="text-lg font-semibold text-gray-800 group-hover:text-blue-700">
        Enterprise-Grade Security
      </h3>
      <p class="text-gray-600 mt-1">
        Bank-level encryption and compliance with SOC 2, GDPR, and HIPAA
        means your data stays protected 24/7.
      </p>
    </li>
    
    <li class="group">
      <h3 class="text-lg font-semibold text-gray-800 group-hover:text-blue-700">
        Real Human Support
      </h3>
      <p class="text-gray-600 mt-1">
        Get help from actual experts who understand your business, not chatbots
        or overseas call centers that don't get it.
      </p>
    </li>
    
```

This example brings together several techniques we've covered. The blue markers create brand consistency, the larger marker size adds visual weight to important points, and the subtle hover effects provide just enough interactivity without being distracting.

What about limitations?

I'll be honest with you – the marker: variant does have some limitations. Since it targets the ::marker pseudo-element, you can only style text properties like color, font-weight, and font-size. Things like background colors, borders, and complex layouts won't work.

But don't worry! When you need more control, you can build custom list layouts with flexbox instead:

```html
  • Complete design control

    Custom markers with backgrounds, borders, and complex styling

  • 2

    Flexible positioning

    Align markers exactly where you want them to be

```

Sure, it's a bit more markup, but you get complete control over how everything looks and behaves.


That's it for this one! List markers might seem like small details, but they really do make a huge difference in how users perceive and interact with your content.

With Tailwind CSS's marker styling tools, you can create lists that not only look great but also support your brand and improve the overall user experience. Trust me, once you start using these techniques, you'll wonder how you ever built lists without them!

I hope you learned something useful here. Stay tuned for more Tailwind CSS tips and tricks!

Other posts you might like...

See more

Subscribe to our newsletter

Get notified when we add new templates, components, and more!

Thanks for subscribing!
Please check your email to confirm your subscription.

WindyBase Make development a breeze

WindyBase is a weekly curated Tailwind CSS template and tool directory built for the modern developer.

© 2025 WindyBase. All rights reserved.