“请求”div 中的链接显示不正确。对于 style.css 中此 div 中的链接,有以下代码:
.header .request a span{border-bottom:1px dotted}.header .request a:hover span{border-bottom:0}
证明:berdyanskaya56.ru
在页面上,当链接悬停时,她会带有下划线。相比之下,在 .css 中明确指出它应该是无装饰的。我该如何解决这个问题?
更新: -> 目标:在悬停时在 div“请求”中创建链接点下划线,在悬停时不加下划线。链接样式的所有属性都应该写在.css中,而不是在html中(不要在index.html中写style="text-decoration:none")。
最佳答案
这个工作正常。只需添加
div.header div.request a {
text-decoration: none;/*add this*/
}
.header .request a span {
border-bottom: 1px dotted
}
.header .request a:hover span {
border-bottom: 0
}
div.header div.request a {
text-decoration: none;
}
<div class="header">
<div class="request">
<a href="#">
<span>sadsad</span>
</a>
</div>
</div>
关于html - CSS 链接无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26646556/