【发布时间】:2019-12-29 22:09:34
【问题描述】:
我有一个简单的问题。我已经创建了一个带有 css 属性的按钮,但是如果我使用 button:active 并尝试为某些东西设置动画并不重要,我会在按钮的顶部和左侧得到一些令人讨厌的“阴影”。我怎样才能删除它们?我是 Stack Overflow 的新手,希望我不会在这里做错任何事 :)
button {
width: 50px;
height: 50px;
font-size: 30px;
text-align: center;
transition: 0.3s;
background-color: white;
border-width: 0px;
box-sizing: border-box;
color: grey;
border-color: rgb(70, 196, 255);
box-shadow: none;
}
button:hover {
border-left-width: 5px;
}
button:active {
border-color: rgb(123, 20, 80);
}
button:focus {
outline: 0;
}
body {
background-color: black;
}
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<button></button>
</body>
【问题讨论】:
-
如果我按下按钮,左边框应该会变成紫色,但它会变得近乎黑色。这就是我所说的“影子”。