开发者

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> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜