gpt4 book ai didi

html - 删除按钮周围的灰色框

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

正如标题所说,我无法删除按钮周围的灰色框。我试过使用 outline: none 但没有用。

你可以在这里看到它(JSFiddle):

.btn-group {
background: #4abdac;
background-image: -webkit-linear-gradient(top, #4abdac, 4abdac);
background-image: -moz-linear-gradient(top, #4abdac, 4abdac);
background-image: -ms-linear-gradient(top, #4abdac, 4abdac);
background-image: -o-linear-gradient(top, #4abdac, 4abdac);
background-image: linear-gradient(to bottom, #4abdac, 4abdac);
-webkit-border-radius: 33;
-moz-border-radius: 33;
border-radius: 33px;
font-family: Arial;
color: #000;
font-size: 20px;
padding: 10px 20px 10px 20px;
text-decoration: none;
}
<div><button><a class="btn-group" style="color: #000;" href="www.example.com"><span style="color: #ffffff;">Example Text&nbsp;</span></a></button></div>

最佳答案

在您的问题中,您没有删除按钮的默认样式,这就是您获得灰色背景的原因。您可以使用这种样式删除它:

button {
border:none;
background-color:transparent;
outline:none;
}

然后你不需要在按钮内使用 anchor 标记 - 只需像这样调用:

.btn-group {
background: #4abdac;
background-image: -webkit-linear-gradient(top, #4abdac, 4abdac);
background-image: -moz-linear-gradient(top, #4abdac, 4abdac);
background-image: -ms-linear-gradient(top, #4abdac, 4abdac);
background-image: -o-linear-gradient(top, #4abdac, 4abdac);
background-image: linear-gradient(to bottom, #4abdac, 4abdac);
-webkit-border-radius: 33;
-moz-border-radius: 33;
border-radius: 33px;
font-family: Arial;
color: #fff;
font-size: 20px;
padding: 10px 20px 10px 20px;
text-decoration: none;
border:none;
}
<div>
<button class="btn-group" onclick="window.location.href='www.example.com'">Example Text</button>
</div>

关于html - 删除按钮周围的灰色框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45546496/

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