Solved

CSS links

Posted on 2010-11-29
8
300 Views
Last Modified: 2012-05-10
Hi,

I read as


When setting the style for several link states, there are some order rules:
a:hover MUST come after a:link and a:visited
a:active MUST come after a:hover


I have not understood
>>>>a:hover MUST come after a:link and a:visited
why a:hover has to come after a:visited esp when user first time visits link he need not have visited link earlier right. Please advise. Any links resources, sample code, ideas highly appreciuated thanks in advance
0
Comment
Question by:gudii9
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 10

Accepted Solution

by:
hosneylk earned 167 total points
ID: 34236533
0
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 167 total points
ID: 34237790
It means they must be declared after each other in the stylesheet. It is not related to how/when a user actually uses the link.
0
 
LVL 7

Author Comment

by:gudii9
ID: 34240452
hi,

>>>>It is not related to how/when a user actually uses the link.
it is not related with usage but still the order of declaration is important? why is it so. please advise

0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34240597
The order is important because of the "cascading" thing. The last declared rule overrides the ones declared before it. So they need to be in Link, Visited, Hover, Active sequence for them to be applied correctly by the browser.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 8

Assisted Solution

by:Zado
Zado earned 166 total points
ID: 34249825
0
 
LVL 8

Expert Comment

by:Zado
ID: 34317455
Please grant the points and close the question, thanks :-)
0
 
LVL 8

Expert Comment

by:Zado
ID: 34384858
To be clear here: I'm not asking for grant the points to me, but generally.
If you have a problem with any suggestion from experts or nothing works with your expectation, please let us know, so we will continue work on solution for you, thanks.
0
 
LVL 7

Author Comment

by:gudii9
ID: 34461931
>>>> The last declared rule overrides the ones declared before it.
Last declared means the recently declared one. How we know which one has to be declared last. So the link miust be last one declared (after Visited, Hover, Active sequence). please advise
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now