I’m not quite sure why, but the CSS code in this fiddle does not work properly in Chrome. In Firefox, if you hover on one of the li elements, the text would become visible but not in Chrome. Apparently, in Chrome if you change the display attribute on hover, the whole CSS rule for the li element would just get ignored (The state doesn’t change to hover actually). However, if you use the Chrome Developer Tools to change the state of the element manually, it’d work just fine. Am I missing something here? Or is this a bug in Chrome? I’ve tested this in Chrome 22 (stable release) and 24 (dev channel release).
I’m not quite sure why, but the CSS code in this fiddle does not
Share
I don’t know what is getting ignored as you said, because I see no difference, but by removing
display: inline;and it works
My Fiddle
Updated Fiddle assuming you need to have a background color for the text
Updated Fiddle
HTML
CSS
While having the text wrapped in a
spanwould allow you to modify thedisplayattribute, it’s redundant in this case because you want to set it toinline. Wrapping it inside thespanelement is enough.