CSS: Skip underline in part of link
Is it possible to have a contiguous link, where the text is normally underlined on mouse hover, but in the middle have a section (eg an image) without this underline? This does not wo开发者_C百科rk:
<a href="#">one <span style="text-decoration:none;">two</span> <img src="img.png" style="border:0px; text-decoration:none;"> three</a>
Make a class that hides underlines, and child class that adds them.
.underline-some {
text-decoration: none;
}
.underline-some:hover .text {
text-decoration: underline;
}
<a href="#" class="underline-some">
<span class="text">Boyz</span>
精彩评论