gpt4 book ai didi

html - 单击按钮禁用文本选择

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

当用户单击按钮时,如何避免在文本周围出现一个虚线选择矩形,请参见下图。我已经尝试添加 css 规则 user-select: none;,这是我在另一个问题中看到的,但这似乎不起作用。

rectangle around the text when the user clicks the button

有什么建议吗?

编辑:该问题仅出现在 Firefox 中(使用 47.0 版测试)

.button {
background-color: #1a1a1a;
border: none;
color: #f8f8f8;
padding: 10px 40px;
text-align: center;
display: inline-block;
font-size: 16px;
border-radius: 4px;
user-select: none;
-webkit-transition-duration: 0.3s;/* Safari */
transition-duration: 0.3s;
}
.button:hover {
background-color: #595959;
/* Green */
color: white;
}
<button class="button">Button</button>

最佳答案

对于在 Firefox 中删除按钮中的虚线边框:

button::-moz-focus-inner {
border: 0;
}

关于html - 单击按钮禁用文本选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38526301/

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