views:

165

answers:

2

Could anybody tell me with the pseudo class :active from css only works in IE7?

You can check my code on the following web page. www.ercesar.com

UPDATED What I mean is what it does on IE7, which once you click on the menu item, the image and the background image change even when you go away from the menu item.

I hope it helps to understand what I mean.

Thnaks in advance.

Cesar.

+1  A: 

:active will work in chrome too (tested).

According to w3schools, it is supported in IE, Firefox, Opera, Chrome, and Safari.

Joel Potter
+2  A: 

Please be more specific if not, but here's what I think you mean. You'd like the menu item to stay white/highlighted when you click it. But the :active class is really made for when something is clicked--and only then. This works cross-browser as intended.

To do what you seem to want to do, you may need to imploy javascript, or just actually link off to another page. What you seem to want is a 'here' state--which may sound conceptually like an 'active' state. You define this in CSS by, for example, giving your body a class that matches up to the class in your menu item, and styling appropriately. Or by giving the menu item a class 'here' if you can do that programmatically. Example:

.home #menu .home a { color:white; }
D_N