【发布时间】:2020-07-02 11:10:30
【问题描述】:
嘿,当它悬停时,我想为我的按钮添加一个边框。在我的代码下面:
button{
background-color: #e876f5;
font-size: 20px;
color: white;
border-radius: 3px;
}
button:focus{
outline: none;
}
button:hover{
background-color: white;
border: 2px solid #e876f5;
color: #e876f5;
cursor: pointer;
}
我认为添加border: 2px solid #e876f5; 就足够了,但是当我悬停按钮时,没有边框。我该怎么办?
【问题讨论】:
-
这里没有问题,你能给我们看看html吗?
-
正如@Zdravko 所说的所有工作,唯一想到的是类上有一个覆盖。
-
我的 HTML 中没有边框...
<button type="button" style="width: 600px; height:40px; border:none;">现在可以使用