Blabberbox » IE8 CSS Backgrounds on A:HoverShare on Twitter

IE8 CSS Backgrounds on A:Hover

March 20th, 2011 | Posted by pftq in Blabberbox | #
This is an odd bug, but if you try to specify a background for a link on hover (a:hover), the background may not take effect in Internet Explorer 8.  Fortunately it is an easy fix but not very obvious.

Basically make sure to specify the background in the non-hover state; if there is none, then set it to transparent.  Your CSS would then look like this:

a {
a:hover {
background-color:#CCC; /* or whatever color you want */

Hopefully this saves some time for someone out there.  It took a while of playing around to finally get it working but ah well. Tongue
1222 unique view(s)

Leave a Comment

Name: (Have an account? Login or Register)
Email: (Won't be published)
Website: (Optional)
Enter the code from image: