Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Hassine

macrumors newbie
Original poster
Jan 23, 2015
7
0
Hello,

I have a list <ul> composed of some <li>. I want to change the color of a <li> text when the mouse is on the hole <li>: in other words, when the mouse is on the correspondant text and on the empty space before and after the text. I tried to apply hover, but the text change it's colour just when the mouse is on the text. Here is an illustration of what hover shows as result (the arrows represent the mouse)

Help me please, thanks :)
 

Attachments

  • 1.PNG
    1.PNG
    2.9 KB · Views: 380
  • 2.PNG
    2.PNG
    2 KB · Views: 354
Here's adding in anchor tags, keep in mind use the anchor tag as the :hover won't change the color of the list-style-type icon list the above example. Though looking at your image you could use a custom image or use a pseudo element like a :before or :after (single colon for IE8 support).

http://jsfiddle.net/yqeczd4f/2/

Added in a transition just for kicks.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.