Whats the correct order of styling the <a>
element (link, visited, hover, active). All are confusing by providing different combination like LVHA, LAHV. Can anybody specify the correct ordering?
views:
98answers:
2
+4
A:
Link Visited Hover Active
To quote from the CSS specification:
a:link { color: red } /* unvisited links */ a:visited { color: blue } /* visited links */ a:hover { color: yellow } /* user hovers */ a:active { color: lime } /* active links */
Note that the A:hover must be placed after the A:link and A:visited rules, since otherwise the cascading rules will hide the 'color' property of the A:hover rule. Similarly, because A:active is placed after A:hover, the active color (lime) will apply when the user both activates and hovers over the A element.
Daniel A. White
2009-10-08 10:06:43
when a visited it turns all links color to visited color.why it happens
Paniyar
2009-10-08 10:16:35
Because you visited all links before? Just a guess ...
Joey
2009-10-08 10:19:07
no its happens newly loaded page.
Paniyar
2009-10-08 10:20:14
Have you visited the pages the links point to before? May well be months ago. You can try making up links you never visited before to test unvisited links. In developing a web site I noticed you usually have visited all links that appear.
Joey
2009-10-08 10:23:18
i fix the problem. my links are all point to same page(#) .anyway thanks for your post
Paniyar
2009-10-08 11:10:28
A:
You might prefer VLHA ordering as well, which makes no difference. However CSS spec specified LVHA ordering and, in fact, this one is easy to memorize: i LoVeHA!
Comptrol
2010-03-03 11:05:21