gpt4 book ai didi

css - 悬停时添加大纲

转载 作者:太空宇宙 更新时间:2023-11-04 13:03:20 25 4
gpt4 key购买 nike

我正在为我的网站创建一个“返回顶部”按钮。当我将鼠标悬停在 <a> 上时出现蓝色轮廓,我不知道如何摆脱它。我遗漏了什么?

这是它在正常状态下的样子:
enter image description here

悬停时:
enter image description here

HTML:

<p id="back-top">
<a href="#top"><span></span>Back to Top</a>
</p>

CSS:

#back-top {
position: fixed;
bottom: 30px;
right: 100px;
}
#back-top a {
width: 70px;
display: block;
text-align: center;
font: 11px/100% Arial, Helvetica, sans-serif;
text-transform: uppercase;
text-decoration: none;
color: #bbb;
/* transition */
-webkit-transition: 1s;
-moz-transition: 1s;
transition: 1s;
}
#back-top a:hover {
color: #004276;
border: none !important;
outline: none !important;
}
#back-top a:hover span {
background-color: #777;
outline: none !important;
border: none !important;
}
#back-top a span {
width: 70px;
height: 50px;
display: block;
margin-bottom: 7px;
background: url("../images/BackToTop.png") no-repeat center center;
/* transition */
-webkit-transition: 1s;
-moz-transition: 1s;
transition: 1s;
}

最佳答案

您的问题是您在悬停时向 SPAN 添加了背景色。

因为你有一个背景图片,上面有一个边框半径,然后背景颜色显示在它下面。

要修复它,只需从您的 css 中删除以下内容:

#back-top a:hover span {
background-color: #777; /* REMOVE THIS LINE */
outline: none !important;
border: none !important;
}

祝你好运!

关于css - 悬停时添加大纲,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25309061/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com