<div class = "shared_link_post_container">
<a id="{{post.status_id}}_shared_link_img" href="{{post.link}}" target="_blank">
<img src="{{post.picture}}">
</a>
<a id="{{post.status_id}}_shared_link_text" class="shared_link_text" href="{{post.link}}" target="_blank">
<div id="{{post.status_id}}_clickable_text_box" class="clickable_text_box">
<br>
<span class="shared_link_name">{{post.name}}</span>
<br>
<span class="unlinked shared_link_caption">{{post.caption}}</span>
<br>
<br>
<span class="unlinked shared_link_description">{{post.description}}</span>
</div>
</a>
</div>
当链接悬停时,我希望类unlinked
的链接没有下划线。我试过了:
.unlinked {
color: gray;
font-weight: normal;
text-decoration: none;
}
这似乎不起作用,主要是因为我的unlinked
类应该是a
类。但是,我不想删除所有链接的下划线,只需删除unlinked
类。
答案 0 :(得分:2)
将span
转换为块级元素,然后转换为:
.shared_link_name {
display: inline-block;
text-decoration: underline;
}
.shared_link_name:hover {
text-decoration: none;
}
答案 1 :(得分:1)
使用以下代码:
.unlinked {
display: inline-block;
color: gray;
font-weight: normal;
text-decoration: underline;
}
/* For hover condition */
.unlinked:hover {
text-decoration: none;
}