Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CSS links

Posted on 2010-11-29
8
Medium Priority
?
338 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 10

Accepted Solution

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

Assisted Solution

by:Carl Tawn
Carl Tawn earned 668 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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
 
LVL 8

Assisted Solution

by:Zado
Zado earned 664 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

721 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