【发布时间】:2011-03-04 11:26:58
【问题描述】:
我有一个带有单个样式按钮的简单测试页面。当您将鼠标悬停在按钮上时,我正在使用 a:hover。但是,当您单击按钮时,a:hover 样式仍然存在,直到我单击其他内容为止。我该如何解决这个问题?为什么会这样?
谢谢, 棒。
<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;
}
【问题讨论】:
标签: jquery css asp.net-mvc ajax