CSS question

  • Thread starter Thread starter Goofy
  • Start date Start date
G

Goofy

I have some hyperlink controls on my webform. I am trying to get the
currently selected link to display Black text on white background. This
does not seem to work. When you click it, it goes to the active class, but
when the mouse button is released, it goes back to A.mnu class.



Any help would be appriciated



A.mnu

{

font-family:Arial,helvetica, Univers 45 Light;

font-size:9pt;

color:White;

background-color: rgb(153,204,0);

}

A.mnu:link

{

font-family:Arial,helvetica, Univers 45 Light;

font-size:9pt;


}

A.mnu:visited

{

text-decoration:none;

}

A.mnu:hover

{

background-color: rgb(0,204,0);



}

A.mnu:active

{

background-color:White;

color:black;

text-decoration:none;


}

A.mnu:selected

{

background-color:White;

color:black;

text-decoration:none;

}
 
You have several different styles defined for the link. Each of these
represents a different state:

A.mnu - Default state (not clicked, not hovered, and not visited)
A.mnu:link - Normal state (not clicked, not hovered, and not visited) -
using a Pseudo-class
A.mnu:visited - Visited state (after the resource has been previously
visited by this browser)
A.mnu:hover - Hovered state (mouse is over the anchor/link)
A.mnu:active - Mouse-Down state (mouse is down on the anchor/link)
A.mnu:selected - Incorrect. There is no "selected" pseudo-class.
- Perhaps you want "focus" - anchor/link has the focus regardless of
mouse.

This should explain the behavior you're describing.

--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

Never trust a dunderhead with a blunderbuss.
 
Thanks

You are correct, the focus was the key, unfortunately, this was not really
any good,because I was using it to format menu link, and of course once the
user clicked on the form, the active indicator was gone, so I set this
instead in code which results in an inline style which fixes the active
hyperlink but still allows for the others to subscribe to hover

Regards - Goofy


Kevin Spencer said:
You have several different styles defined for the link. Each of these
represents a different state:

A.mnu - Default state (not clicked, not hovered, and not visited)
A.mnu:link - Normal state (not clicked, not hovered, and not visited) -
using a Pseudo-class
A.mnu:visited - Visited state (after the resource has been previously
visited by this browser)
A.mnu:hover - Hovered state (mouse is over the anchor/link)
A.mnu:active - Mouse-Down state (mouse is down on the anchor/link)
A.mnu:selected - Incorrect. There is no "selected" pseudo-class.
- Perhaps you want "focus" - anchor/link has the focus regardless of
mouse.

This should explain the behavior you're describing.

--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

Never trust a dunderhead with a blunderbuss.
 
Back
Top