gpt4 book ai didi

css - 如何摆脱悬停时附加的内置 CSS?

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

我使用的是 Safari 浏览器,我有这样的按钮 -

enter image description here

悬停时如下所示 -

enter image description here

我这边没有添加任何 css,但是在检查元素时我得到了这个-

button:hover {
box-shadow: 0px 0px 1px #b2b2b2;
border-left-color: #575757;
border-right-color: #575757;
}

我想让它在悬停或不悬停时看起来一样。所以我尝试将 css 设置为-

button:hover {
box-shadow: none;
border-left-color: none;
border-right-color: none;
}

但它不起作用。

最佳答案

您可以使用此代码

      button {
box-shadow: 0px 0px 1px #b2b2b2;
background-color: #ffffff;
border: 1px solid #575757;;
outline: none;
padding: 15px 30px;
text-decoration: none;
border-radius: 15px;
font-size: 25px;
font-weight: 600;
color: #333333;
}
button:hover {
box-shadow: 0px 0px 1px #b2b2b2;
background-color: blue;
border: 1px solid #575757;;
outline: none;
padding: 15px 30px;
text-decoration: none;
color: white;
}
  <button type="button">Prev</button>
<button type="button">1</button>
<button type="button">2</button>
<button type="button">3</button>
<button type="button">Next</button>

关于css - 如何摆脱悬停时附加的内置 CSS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58091444/

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