RE:[css-d] Order To Declare Link Anchors

2005-08-15 Thread BJ

"I've read there is a specific order which the anchors should be declared"


Correct order:
a
a:link
a:visited
a:hover
a:active


---
avast! Antivirus: Outbound says I'm squeaky clean.
Virus Database (VPS): 0533-0, 08/15/2005
Tested on: 8/15/2005 12:14:46 PM


__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


RE: [css-d] Order To Declare Link Anchors

2005-08-18 Thread Leszek
Easiest way to remember this:

LoVe/HAte

L = link
V = Visited
H = Hover
A = Active

- Leszek
http://leszek.swirski.co.uk

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> discuss.org] On Behalf Of BJ
> Sent: 15 August 2005 17:15
> To: [EMAIL PROTECTED]; css-d@lists.css-discuss.org
> Subject: RE:[css-d] Order To Declare Link Anchors
> 
> "I've read there is a specific order which the anchors should be declared"
> 
> 
> Correct order:
> a
> a:link
> a:visited
> a:hover
> a:active
> 
> 
> ---
> avast! Antivirus: Outbound says I'm squeaky clean.
> Virus Database (VPS): 0533-0, 08/15/2005
> Tested on: 8/15/2005 12:14:46 PM
> 
> 
> __
> css-discuss [EMAIL PROTECTED]
> http://www.css-discuss.org/mailman/listinfo/css-d
> List wiki/FAQ -- http://css-discuss.incutio.com/
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Order To Declare Link Anchors

2005-08-18 Thread Michael Landis
On 8/15/05, BJ <[EMAIL PROTECTED]> wrote:
> "I've read there is a specific order which the anchors should be declared"
> 
> 
> Correct order:
> a
> a:link
> a:visited
> a:hover
> a:active

This isn't explicitly defined by the specifications, but comes from
thinking like a browser. :)

When an a tag is a link or it is visited, then a:link or a:visited
apply. When you hover over the link, it is still a link (visited or
otherwise) but now it's hovered as well. This means that both the
original a:link/a:visited _and_ a:hover are used to display the link.
When you click the link, then not only are you hovering over the link,
you are also making it active. And it's still a link.

According to the specs, if two rules have the same specificity and
define the same properties, the property value defined last wins.[1]
In this case, a:link, a:visited, a:hover and a:active all have the
same specificity. So if you're changing colors between states, then
the color defined by a:link or a:visited is defined first. If you
hover over the link, then as long as a:hover is defined after a:link
or a:visited, its color definition will override the link/visited
definition. If, however, you define the a:link/a:visited rules _after_
a:hover, then the color defined by a:hover will be overridden by the
color in a:link/a:visited. The same reasoning explains why a:active is
last.

HTH,

Michael

[1] http://www.w3.org/TR/CSS21/cascade.html#cascading-order (and
follow the "specificity" link for more about it)
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/