#button {
margin-top: 5%;
position: relative;
left: 15%;
}
#button a{
color: #15b097;
}
#button a:hover{
color: white;
}
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<a class="btn btn-default" href="#" role="button" id="button">Create Account</a>
</div>
</div>
这是我第一次遇到按钮悬停没有改变的情况。它从来没有发生在我身上我不知道出了什么问题。也许有什么特别的地方出了问题我不知道。 希望我没有让您感到困惑,因为我已经在这里感到困惑,不断更改类名并且没有用。只有对齐才有效。我做了背景颜色和颜色。
最佳答案
你的按钮带有a标签
,所以不需要使用#button a
。
更新的 CSS:
#button {
margin-top: 5%;
position: relative;
left: 15%;
color: #15b097;
}
#button:hover{
color: white;
}
关于html - 按钮悬停颜色不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35814375/