JerryDDG
JerryDDG

Reputation: 61

issues when using pseudo-classes

I got some problem when I read <CSS: The Definitive Guide>. In page 55, "Real-world issues with dynamic styling" part, The author raised an example:

a:link, a:visited {font-size: 13px;}
a:hover {font-size: 20px;}

and said:

However, the CSS specifications state that user agents are not required to redraw a document once it's been rendered for initial display, so you can't absolutely rely on your intended effect taking place. I strongly recommend that you avoid designs that depend on such behavior.

I thought the author didn't explain clearly. And it's more complex to realize such behavior by using javascript. Why shouldn't I use pseudo-classes like this?

Are there any guy could tell me in which case such behavior will cause bad consequences?

Upvotes: 0

Views: 44

Answers (1)

Justinas
Justinas

Reputation: 43479

When your browser does not support pseudo-classes, these styles will be ignored. You can still use js/jsquery. But most modern browsers now support pseudo-classes.

Upvotes: 1

Related Questions