I have a text link that is underlined when hovered. I’m adding at the beginning of the link a > symbol using the following code:
.box.blueb a { color: #0098aa; }
.box.blueb a:hover { text-decoration: underline; }
.box.blueb a:before { content: "> "; }
.box.blueb a:before:hover { text-decoration: none; }
But what I don’t want the > symbol underlined when the link is hovered. How do I achieve this?
http://jsfiddle.net/thirtydot/LmvgM/1/
You need to wrap a
spanaround the text inside thea:And then change your CSS to this:
.box.blueb a:before:hover { text-decoration: none; }doesn’t work because when you settext-decoration: underlineon an element (thea), you can’t then remove it on a descendant (:before).