a:hover { text-decoration: none; }
a:hover span { text-decoration: underline; }
Use text-decoration
property of a:hover
on <span>
.
Have a look at the snippet below:
a { text-decoration: none; } a span { text-decoration: underline; }
<a class="boost_author" href="#"> <img class="boost_author-avatar img-circle" src="/images/profile_photo.jpg" width="20" height="20"> <span class="boost_author-username">johndoe</span> </a>
Hope this helps!
Restricting the styles only for the classes
a.b_author{
text-decoration: none;
}
a.b_author:hover span.b_author-username{
text-decoration: underline;
}
And this for many others elements, general purpose
a{
text-decoration: none;
}
a:hover span{
text-decoration: underline;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.