链接和跨此链接内的跨度的文本修饰 [英] Text decoration for link and span inside this link
本文介绍了链接和跨此链接内的跨度的文本修饰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有类似的链接:
<a href="#">Link text<span>Link sub-text</span></a>
当悬停时,我需要跨度内的文本未用下划线修饰(但主链接文本是).是否可以?我尝试过:
When hovering I need that text inside span is not decorated with underline (but main link text is). Is it possible? I've tried:
a:hover span {text-decoration:none;}
这不起作用.
有什么解决办法吗?
推荐答案
在< span>
内添加链接文本(您希望用下划线修饰的文本),并在外部添加子文本.链接文本,例如:< a href =#">< span>链接文本</span>子文本</a>
Add link text (text you want to be decorated with underline) inside <span>
and the sub-text outside as normal link text, like:
<a href="#"><span>Link text</span>sub-text</a>
要装饰链接文本,请使用:
To decorate Link text use:
a:hover {
text-decoration:none;
}
a:hover span {
text-decoration:underline;
}
这篇关于链接和跨此链接内的跨度的文本修饰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文