css style remains after click

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. <% using (Ajax.BeginForm(new AjaxOptions ))<br /…

via Css Website development » Search Results » ajax:

css style remains after click

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.

<% using (Ajax.BeginForm(new AjaxOptions ))
%>

<% %>
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;

………………………………………

It’s the a:focus which makes it look like the a:hover rule is activated. a:focus matches any link which is focused. When you click a link, it becomes focused.
Remove the a:focus rule and it should be fine.

For more info: css style remains after click

Css Website development » Search Results » ajax

css style remains after click

Share this post:

Related Posts

Leave a Comment