mamal 22

I'm looking for a way to change only an LI's bullet color (not the text of the li) on hover. It is possible to set only the color of bullets with CSS, at least for an entire UL if not for an individual LI. Is there a pure CSS way to change only the bullet color of only the currently hovered LI? Is it only possible if each LI is alone in its own UL? Not sure how this would work. Any thoughts? Barring a pure CSS way to do it, I'm using jQuery, would there be a jQuery way to do it?

6 answers

o.k.w 2355
This was chosen as the best answer

This is the entire working html page code sample which demostrates using ":hover" css selector to trigger the effect and also have a fallback to use javascript to achieve the same effect for older browsers not supporting ":hover".

Discliamer: I've tested it and both css and script worked but I have not test it on IE6 and older browser though. jQuery is used for convenience sake, can be done with just bare javascript from scratch.

Here's the source code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<script type="text/javascript" src=""></script>
<!--[if lte IE 6] >
<script type="text/javascript">
  //the following 2 events manages those browsers (i.e. older IE) not supporting ':hover' css selector
  $('#list li').mouseover(function(){
  $('#list li').mouseout(function(){
<style type="text/css">
#list li {
  color: blue;
#list li span,
#list li:hover span,
#list li.hover span
  color: blue;

/* li.hover is the selector used for browser not supporting ':hover' */
#list li:hover, 
#list li.hover 
  color: red;
<ul id="list">
  <li><span>item 1</span></li>
  <li><span>item 2</span></li>
  <li><span>item 3</span></li>
  <li><span>item 4</span></li>

Screenshots (on IE8):
Before Hover

Answered over 8 years ago by o.k.w

Use an image for your bullet, and then change the image on the :hover psuedo-element.

Answered over 8 years ago by tahdhaze09
  • Yeah, I suppose that's the best solution. mamal over 8 years ago

first off, older IE's won't respect :hover on anything other than an <a> so you'll need Javascript to simulate the pseudo hover on <li> elements.

In the past I've done this by setting the color on the <li> and wrapping its text content (usually a link or span) in another element that doesn't change color on hover.

pseudo :hover can be done with whatever:hover or by some element targeting with jQuery

Answered over 8 years ago by Tony Crockford

image + li:hover (it works even in IE 7, just remember that you have to use a strict doctype)

Answered over 8 years ago by Alexandru Bucur
Ax Bar 5

For a pure CSS approach you could do something like this:

ul, li:hover > *

It's limited in that you need to wrap the content of your < li> in a < span> (or another tag) and it fails on browsers that don't handle the :hover pseudo class properly.

Answered over 8 years ago by Ax Bar

I found a great page on how to change the list item image using jQuery. It is super simple and more browser compliant than css.

Answered over 7 years ago by combs1945