gpt4 book ai didi

html - CSS 按钮边框由于某种原因无法正常工作

转载 作者:行者123 更新时间:2023-11-28 04:15:42 24 4
gpt4 key购买 nike

我已经为 css 按钮添加了边框,但由于某种原因,它没有生效。

有人可以建议修复,在片段中附加代码

body {
background: grey;
}

a.button {
display: inline-block;
-webkit-appearance: button;
-moz-appearance: button;
appearance: button;
text-decoration: none;
background-color: black;
border: 1px solid white;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
font-size: 16px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>CSS BUTTON</title>
</head>
<body>
<a href="#test" class="button">Click Me</a>
</body>
</html>

最佳答案

使用-webkit-appearance: none;关闭 iOS 默认按钮样式,而不是“按钮”。 A great article here .我附上了您的按钮的代码:

body {
background: blue;
}

a.button {
display: inline-block;
/*-webkit-appearance: button;
-moz-appearance: button;
appearance: button;*/
-webkit-appearance: none;
text-decoration: none;
background-color: black;
border: 1px solid white;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
font-size: 16px;
}
<a href="#test" class="button">Click Me</a>

关于html - CSS 按钮边框由于某种原因无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57765011/

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