【发布时间】:2017-05-30 21:19:03
【问题描述】:
当我将鼠标悬停在 div 上时,div 的外部有一条白线。 我试过 text-decoration: none;
知道如何删除它吗?
这是html
<a href="/" style="color:white">
<div class="headerOption">
<p>
Home
</p>
</div>
</a>
SCSS
.headerOption {
border-radius: 5px;
width: 6vw;
height: 2.8vw;
font-size: 0.97vw;
font-weight: 500;
@include normal;
font-family: "Rubik-Medium", sans-serif;
cursor: pointer;
p {
position: relative;
top: 30%;
}
&:active {
background-color: rgba(255, 255, 255, 0.1);
}
&:hover {
background-color: rgba(255, 255, 255, 0.1);
}
}
a:hover {
text-decoration: none;
}
【问题讨论】:
-
能否也请包含您的 CSS。
-
我想你的意思是
text-decoration: none;。 -
是的,对不起。修好了
-
您提供的 CSS 与您提供的图片不匹配。
-
问题解决了,原来是 bootstrap 的样式覆盖了我的样式。 !important 解决了。