css style remains after click

Posted by rod on Stack Overflow See other posts from Stack Overflow or by rod
Published on 2010-06-16T13:29:45Z Indexed on 2010/06/16 13:32 UTC
Read the original article Hit count: 292

Filed under:
|
|
|
|

Hi All,

I have a simple test page with a single styled button. I'm using a:hover when you hover over the button. However, when you click the button the a:hover style remains until I click on something else. How would I fix this and why is this happening?

Thanks, rod.

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">

    <% using (Ajax.BeginForm(new AjaxOptions { }))
       { %>
    <div id="detailActions">
        <a href="#">Delete User</a>
    </div>
    <% } %>
</asp:Content>

My 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;
}

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about jQuery