4 replies [Last post]
filmen
Offline
newbie
Portugal
Last seen: 12 years 39 weeks ago
Portugal
Joined: 2007-10-30
Posts: 8
Points: 0

Hi,

I currently have the following code,

#navTop a:link { color:#AAAAAA; text-decoration: none; } #navTop a:hover { color:#AAAAAA; text-decoration: underline; } #navTop a:visited { color:#AAAAAA; text-decoration: none; } #navTop a:active { color:#AAAAAA; text-decoration: none; }

in order to define the behavior of every link inside the 'navTop' DIV. They don't work... After the link is clicked, the :visited condition prevails and blocks the :hover instructions from having any effect. If I create a normal class and apply it to the links it works just fine. Any suggestions? Thanks.

Triumph (not verified)
Anonymous's picture
Guru

You have to define them in

You have to define them in order:

:link
:visited
:focus
:hover
:active

filmen
Offline
newbie
Portugal
Last seen: 12 years 39 weeks ago
Portugal
Joined: 2007-10-30
Posts: 8
Points: 0

Link behavior

Thanks, fits like a glove. Is it as if the browser would check the conditions one by one, in that same order, applying the last applicable condition?

soundscape
soundscape's picture
Offline
Enthusiast
Kansas City Metro
Last seen: 11 years 17 weeks ago
Kansas City Metro
Joined: 2007-10-18
Posts: 188
Points: 0

It's the cascade part of

It's the cascade part of Cascading Style Sheets.

"The later a declaration appears in the style sheet or document, the more weight it is given."
"CSS; The Definitive Guide"

~Soundscape
www.kenlange.com

Triumph (not verified)
Anonymous's picture
Guru

soundscape wrote:It's the

soundscape wrote:
It's the cascade part of Cascading Style Sheets.

"The later a declaration appears in the style sheet or document, the more weight it is given."
"CSS; The Definitive Guide"
Of course that can be overridden by specificity.