我有一个简单的测试页面,带有一个样式化的按钮。当你将鼠标悬停在按钮上时,我使用的是:hover。但是,当您单击按钮时,a:悬停样式将保留,直到我单击其他内容。我该如何解决这个问题?为什么会发生这种情况?
谢谢,
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
<% using (Ajax.BeginForm(new AjaxOptions { }))
{ %>
<div id="detailActions">
<a href="#">Delete User</a>
</div>
<% } %>
</asp:Content>
我的CSS:
#detailActions
{
margin-bottom: 7px;
padding: 3px 0px 5px 0px;
}
#detailActions
{
padding: 1px 7px 1px 7px;
margin: 0px 5px 0px 0px;
border: solid 1px gray;
background-color: #ADD8E6;
cursor: pointer;
width: auto !important;
font-weight: bold;
text-decoration: none;
color: #003366;
font-size: 1.2em;
}
#detailActions a:hover, #detailActions a:active, #detailActions a:focus
{
color: White;
background-color: #00008B;
}