Sonic42
Sonic42

Reputation: 689

Can :hover and :active be Defined Together?

I know that definitions for :hover must come before the definition for :active in my style sheets. However, is it acceptable to define both styles together (example follows)?

p a:hover, p a:active 
{
   text-decoration: underline;
}

Upvotes: 1

Views: 6029

Answers (1)

Tim
Tim

Reputation: 9489

Yes sure it is, even saves space!

BTW:

  • a:hover MUST come after a:link and a:visited
  • a:active MUST come after a:hover

Upvotes: 10

Related Questions