Solved

CSS links

Posted on 2010-11-29
8
310 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to use embargo Date/time in php 29 35
css issues with IE 11 8 33
AdminLTE with wordpress 15 51
Add box and text color changing for everything 1 24
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

785 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