tags:

views:

53

answers:

1

In my CSS file, I have defined a class as given below.

input.entryFormInputBoxColor:focus
{
    background-color:cyan;
}

When I use Firefox (3.5.5), the Input Box background color changes to cyan when there is focus, but it is not changing in IE (6.0). The class is successfully executing in Firefox, and all other classes defined, work well in IE too, but the above given class fails in IE.

+3  A: 

Internet Explorer did not support the :focus pseudo-class until IE8, and only then when a !DOCTYPE is declared.

Here is a nice overview of CSS compliance from IE6 to IE8:

http://www.smashingmagazine.com/2009/10/14/css-differences-in-internet-explorer-6-7-and-8/

You can overcome this pretty easily with javascript, for example: jQuery's focus() and blur() events.

carillonator