<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Ordering the Link States</title>
	<atom:link href="http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/feed/" rel="self" type="application/rss+xml" />
	<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/</link>
	<description>Things that Eric A. Meyer, CSS expert, writes about on his personal Web site; it&#039;s largely Web standards and Web technology, but also various bits of culture, politics, personal observations, and other miscellaneous stuff</description>
	<lastBuildDate>Fri, 19 Mar 2010 00:27:46 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: CSS Code Snippets : 15 Wicked Tricks &#124; DevSnippets</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-438859</link>
		<dc:creator>CSS Code Snippets : 15 Wicked Tricks &#124; DevSnippets</dc:creator>
		<pubDate>Wed, 28 Jan 2009 06:34:17 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-438859</guid>
		<description>[...] Eric Meyer explains why the order matters. So in case you came across the “link-visited-hover-active” (LVHA) rule. This holds that the four link states should always be listed in that order, like so: [...]</description>
		<content:encoded><![CDATA[<p>[...] Eric Meyer explains why the order matters. So in case you came across the “link-visited-hover-active” (LVHA) rule. This holds that the four link states should always be listed in that order, like so: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gerrit van Aaken</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-191120</link>
		<dc:creator>Gerrit van Aaken</dc:creator>
		<pubDate>Fri, 29 Jun 2007 07:49:51 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-191120</guid>
		<description>I&quot;m with Jens. My favourite rule is &quot;Lord Vader&quot;s Former Handle Anakin&quot;.</description>
		<content:encoded><![CDATA[<p>I&#8221;m with Jens. My favourite rule is &#8220;Lord Vader&#8221;s Former Handle Anakin&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stumpy</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-178630</link>
		<dc:creator>Stumpy</dc:creator>
		<pubDate>Mon, 18 Jun 2007 08:25:53 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-178630</guid>
		<description>I remember reading something a few years ago that used this piece of wisdom to remember the order:
[L]uther [V]andross [F]ans [H]ate [A]bba.

Brilliant.</description>
		<content:encoded><![CDATA[<p>I remember reading something a few years ago that used this piece of wisdom to remember the order:<br />
[L]uther [V]andross [F]ans [H]ate [A]bba.</p>
<p>Brilliant.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Hucklesby</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-172169</link>
		<dc:creator>David Hucklesby</dc:creator>
		<pubDate>Tue, 12 Jun 2007 05:55:38 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-172169</guid>
		<description>I hope we can get this sorted. Using :focus in the middle or at the beginning works to provide keyboard users with pop-up (spanned) images. But attempting to use :active for IE users gives problems--  the :hover does not work well because the :active state &quot;sticks&quot;.

Ever the optimist, I hope there is a CSS solution to this.</description>
		<content:encoded><![CDATA[<p>I hope we can get this sorted. Using :focus in the middle or at the beginning works to provide keyboard users with pop-up (spanned) images. But attempting to use :active for IE users gives problems&#8211;  the :hover does not work well because the :active state &#8220;sticks&#8221;.</p>
<p>Ever the optimist, I hope there is a CSS solution to this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Cherim</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-172052</link>
		<dc:creator>Mike Cherim</dc:creator>
		<pubDate>Tue, 12 Jun 2007 00:51:20 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-172052</guid>
		<description>I place &lt;code&gt;a:focus&lt;/code&gt; before &lt;code&gt;a:active&lt;/code&gt; -- in the typical order of use.</description>
		<content:encoded><![CDATA[<p>I place <code>a:focus</code> before <code>a:active</code> &#8212; in the typical order of use.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Max Design - standards based web design, development and training &#187; Some links for light reading (12/6/07)</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-172014</link>
		<dc:creator>Max Design - standards based web design, development and training &#187; Some links for light reading (12/6/07)</dc:creator>
		<pubDate>Mon, 11 Jun 2007 23:35:32 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-172014</guid>
		<description>[...] Ordering the Link States [...]</description>
		<content:encoded><![CDATA[<p>[...] Ordering the Link States [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GangRel</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-171166</link>
		<dc:creator>GangRel</dc:creator>
		<pubDate>Sun, 10 Jun 2007 15:05:22 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-171166</guid>
		<description>i think hover should overrule focus (lvfha)

Reasoning: 
They only collide, when a mouse-user points on a focused link. at that point the user either knows that the link has focus (he saw it before hovering) or he doesnt care about it having focus. In contrast, all reasons for showing him a hover-effect to reflect his action still apply, since he obviously wants to click and not hit return to open the link.

The lvhfa argument &quot;clicking a button is what I do with them right after I gave them focus&quot; does not feel correct to me, since this &quot;giving focus&quot; is just a sideeffect of clicking/activating and not really user-intended (unlike with textfields), which will make the active:-rule instantly overwrite the focus:-rule anyway (if we stay with the example of just different colors).</description>
		<content:encoded><![CDATA[<p>i think hover should overrule focus (lvfha)</p>
<p>Reasoning:<br />
They only collide, when a mouse-user points on a focused link. at that point the user either knows that the link has focus (he saw it before hovering) or he doesnt care about it having focus. In contrast, all reasons for showing him a hover-effect to reflect his action still apply, since he obviously wants to click and not hit return to open the link.</p>
<p>The lvhfa argument &#8220;clicking a button is what I do with them right after I gave them focus&#8221; does not feel correct to me, since this &#8220;giving focus&#8221; is just a sideeffect of clicking/activating and not really user-intended (unlike with textfields), which will make the active:-rule instantly overwrite the focus:-rule anyway (if we stay with the example of just different colors).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thacker</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-170533</link>
		<dc:creator>thacker</dc:creator>
		<pubDate>Sat, 09 Jun 2007 22:20:26 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-170533</guid>
		<description>Still waiting for Meyer&#039;s analysis and reasoning on the questions that he presented.</description>
		<content:encoded><![CDATA[<p>Still waiting for Meyer&#8217;s analysis and reasoning on the questions that he presented.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jens Meiert</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-168190</link>
		<dc:creator>Jens Meiert</dc:creator>
		<pubDate>Wed, 06 Jun 2007 18:32:52 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-168190</guid>
		<description>&quot;:link, :visited, :focus, :hover, :active&quot; should be the most useful way [...].</description>
		<content:encoded><![CDATA[<p>&#8220;:link, :visited, :focus, :hover, :active&#8221; should be the most useful way [...].</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: patrick h. lauke</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-167455</link>
		<dc:creator>patrick h. lauke</dc:creator>
		<pubDate>Tue, 05 Jun 2007 22:17:51 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-167455</guid>
		<description>off topic a bit, but: an interesting usability enhancement that i recently implemented on a site - style visited links on focus/hover differently from unvisited links on focus/hover...</description>
		<content:encoded><![CDATA[<p>off topic a bit, but: an interesting usability enhancement that i recently implemented on a site &#8211; style visited links on focus/hover differently from unvisited links on focus/hover&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Lee</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-167387</link>
		<dc:creator>Patrick Lee</dc:creator>
		<pubDate>Tue, 05 Jun 2007 20:16:14 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-167387</guid>
		<description>Actually, that&#039;s not quite right.  I&#039;ve used &lt;strong&gt;Las Vegas Federal Housing Authority&lt;/strong&gt; to remember &lt;strong&gt;LVFHA&lt;/strong&gt;.  Fits better with Sin City&#039;s recent growth.</description>
		<content:encoded><![CDATA[<p>Actually, that&#8217;s not quite right.  I&#8217;ve used <strong>Las Vegas Federal Housing Authority</strong> to remember <strong>LVFHA</strong>.  Fits better with Sin City&#8217;s recent growth.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Lee</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-167271</link>
		<dc:creator>Patrick Lee</dc:creator>
		<pubDate>Tue, 05 Jun 2007 16:55:42 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-167271</guid>
		<description>I&#039;m going to stick with &lt;strong&gt;LVFHA&lt;/strong&gt; because I&#039;ve always used &lt;strong&gt;Las Vegas Future Homemakers of America&lt;/strong&gt; to remember the order.  Unless of course you discover some compelling reason why I should change this order and think of a new mnemonic.</description>
		<content:encoded><![CDATA[<p>I&#8217;m going to stick with <strong>LVFHA</strong> because I&#8217;ve always used <strong>Las Vegas Future Homemakers of America</strong> to remember the order.  Unless of course you discover some compelling reason why I should change this order and think of a new mnemonic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian Redl</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-167066</link>
		<dc:creator>Sebastian Redl</dc:creator>
		<pubDate>Tue, 05 Jun 2007 12:00:29 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-167066</guid>
		<description>I&#039;ll join the consensus and say order focus between visited and hover, but I&#039;ll take a different line of reasoning.

The most transient pseudo-class is active. It applies only during the brief time the user holds down the mouse button. Therefore it is the last. As it lasts only a short time, it should override everything else.
The most permanent class is link. It applies to any link. Therefore, it cannot override anything else, it must be the first.
Visited is next after link. It doesn&#039;t apply to all links, but it applies irregardless of current user activity; instead it depends on past user activity. Once visited applies, only time or a history purge will make it not apply.
So the question remains of the relative order of focus and hover. I&#039;d say that the mouse, which causes hovering, is quicker-moving than the keyboard focus, so hover is the more transient state and is ordered later.</description>
		<content:encoded><![CDATA[<p>I&#8217;ll join the consensus and say order focus between visited and hover, but I&#8217;ll take a different line of reasoning.</p>
<p>The most transient pseudo-class is active. It applies only during the brief time the user holds down the mouse button. Therefore it is the last. As it lasts only a short time, it should override everything else.<br />
The most permanent class is link. It applies to any link. Therefore, it cannot override anything else, it must be the first.<br />
Visited is next after link. It doesn&#8217;t apply to all links, but it applies irregardless of current user activity; instead it depends on past user activity. Once visited applies, only time or a history purge will make it not apply.<br />
So the question remains of the relative order of focus and hover. I&#8217;d say that the mouse, which causes hovering, is quicker-moving than the keyboard focus, so hover is the more transient state and is ordered later.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: F.O.R.</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-167065</link>
		<dc:creator>F.O.R.</dc:creator>
		<pubDate>Tue, 05 Jun 2007 11:58:33 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-167065</guid>
		<description>Here&#039;s my take:

a:link {color: blue;}
a:visited {color: purple;}
a:hover {color: red;}
a:focus {color: orange;}
a:active {color: yellow;}

In other words, focus -for an anchor- fits between the active and hover states. The rationale is that I see &#039;focus&#039; as something you do right before interacting with an element.
Thus, I give focus to a textbox before I can type in it, to a button before I can click it. Anchors seem to fit the same pattern. So, hover and focus feel like they should be related, and focus and active too, since typing in a textbox, or clicking a button is what I do with them right after I gave them focus.

At least that&#039;s my story until I get more coffee.
F.O.R.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s my take:</p>
<p>a:link {color: blue;}<br />
a:visited {color: purple;}<br />
a:hover {color: red;}<br />
a:focus {color: orange;}<br />
a:active {color: yellow;}</p>
<p>In other words, focus -for an anchor- fits between the active and hover states. The rationale is that I see &#8216;focus&#8217; as something you do right before interacting with an element.<br />
Thus, I give focus to a textbox before I can type in it, to a button before I can click it. Anchors seem to fit the same pattern. So, hover and focus feel like they should be related, and focus and active too, since typing in a textbox, or clicking a button is what I do with them right after I gave them focus.</p>
<p>At least that&#8217;s my story until I get more coffee.<br />
F.O.R.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Estelle</title>
		<link>http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-166929</link>
		<dc:creator>Estelle</dc:creator>
		<pubDate>Tue, 05 Jun 2007 07:37:02 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comment-166929</guid>
		<description>I agree with Thacker that the focus element should follow the hover rule in the link – visited/ hover / (focus)/ active (&lt;acronym title=&quot;link, visited, hover, focus, active&quot;&gt;LVH(F)A&lt;/acronym&gt;) priority list. This order enables the &lt;code&gt;:focus&lt;/code&gt; and &lt;code&gt;:hover&lt;/code&gt; states to both be visible as appropriate in browsers that support the &lt;code&gt;:focus&lt;/code&gt; pseudo-class. I did debate placing the &lt;code&gt;:focus&lt;/code&gt; state before the &lt;code&gt;:hover&lt;/code&gt; state since mouse action is the default expected activity for web sites, but alternative technologies, especially cell phones, are more likely to use keyboard or keyboard-like navigation. My cell battery is dead, so I can&#039;t test my theory yet, but I realize that if my cell phone, like IE, does not support &lt;code&gt;:focus&lt;/code&gt;, then, like IE, it will ignore it, so i go back to agreeing with Thacker. 

For those using the keyboard to navigate, the &lt;code&gt;:focus&lt;/code&gt; effect will be visible when tabbed, when a mouse user would normally get &lt;code&gt;:hover&lt;/code&gt;.  This &lt;code&gt;:focus&lt;/code&gt; display can be identical to the &lt;code&gt;:hover&lt;/code&gt; look to give the keyboard user the same visual experience as the mouse user. The &lt;code&gt;:hover&lt;/code&gt; and &lt;code&gt;:focus&lt;/code&gt; states should differ enough from the other states of &lt;code&gt;:link&lt;/code&gt;, &lt;code&gt;:visited&lt;/code&gt; and &lt;code&gt;:active&lt;/code&gt; to provide the keyboard and mouse users with enough visual cues to inform the user which link has focus and/or is being hovered.  The &lt;code&gt;:hover&lt;/code&gt; state (and therefore all states) must provide enough padding for the less dexterous to be able to click in the active area.

When declaring &lt;code&gt;:focus&lt;/code&gt; to be relatively very different from the mouse effects so that the keyboard user has strong visual cues as to the current focus, &lt;code&gt;:focus&lt;/code&gt; should be declared after &lt;code&gt;:hover&lt;/code&gt;.  If, on the other hand, &lt;code&gt;:focus&lt;/code&gt; and &lt;code&gt;:hover&lt;/code&gt; are going to be the exact same, then they should be declared together and precedence between the two doesn&#039;t matter.

Note that  padding that is included on&lt;code&gt; :focus&lt;/code&gt; and &lt;code&gt;:hover&lt;/code&gt;  states should be included on all link states to ensure that the content doesn&quot;t move or jump when changing states.</description>
		<content:encoded><![CDATA[<p>I agree with Thacker that the focus element should follow the hover rule in the link – visited/ hover / (focus)/ active (<acronym title="link, visited, hover, focus, active">LVH(F)A</acronym>) priority list. This order enables the <code>:focus</code> and <code>:hover</code> states to both be visible as appropriate in browsers that support the <code>:focus</code> pseudo-class. I did debate placing the <code>:focus</code> state before the <code>:hover</code> state since mouse action is the default expected activity for web sites, but alternative technologies, especially cell phones, are more likely to use keyboard or keyboard-like navigation. My cell battery is dead, so I can&#8217;t test my theory yet, but I realize that if my cell phone, like IE, does not support <code>:focus</code>, then, like IE, it will ignore it, so i go back to agreeing with Thacker. </p>
<p>For those using the keyboard to navigate, the <code>:focus</code> effect will be visible when tabbed, when a mouse user would normally get <code>:hover</code>.  This <code>:focus</code> display can be identical to the <code>:hover</code> look to give the keyboard user the same visual experience as the mouse user. The <code>:hover</code> and <code>:focus</code> states should differ enough from the other states of <code>:link</code>, <code>:visited</code> and <code>:active</code> to provide the keyboard and mouse users with enough visual cues to inform the user which link has focus and/or is being hovered.  The <code>:hover</code> state (and therefore all states) must provide enough padding for the less dexterous to be able to click in the active area.</p>
<p>When declaring <code>:focus</code> to be relatively very different from the mouse effects so that the keyboard user has strong visual cues as to the current focus, <code>:focus</code> should be declared after <code>:hover</code>.  If, on the other hand, <code>:focus</code> and <code>:hover</code> are going to be the exact same, then they should be declared together and precedence between the two doesn&#8217;t matter.</p>
<p>Note that  padding that is included on<code> :focus</code> and <code>:hover</code>  states should be included on all link states to ensure that the content doesn&#8221;t move or jump when changing states.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head profile="http://gmpg.org/xfn/1">
<title>meyerweb.com</title>
<link rel="openid.server" href="http://www.myopenid.com/server">
<link rel="openid.delegate" href="http://emeyer.myopenid.com/">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel="shortcut icon" href="/favicon.ico"><link rel="home" href="http://meyerweb.com/" title="Home" ><link rel="stylesheet" href="http://meyerweb.com/ui/meyerweb.css" type="text/css" media="screen, projection"><link rel="stylesheet" href="http://meyerweb.com/ui/theme.css" type="text/css" media="screen, projection" id="themeLink"><link rel="stylesheet" href="http://meyerweb.com/ui/print.css" type="text/css" media="print"><script src="http://meyerweb.com/ui/addresses.js" type="text/javascript"></script><link rel="stylesheet" href="/ui/wordpress.css" type="text/css" media="screen">
<link rel="stylesheet" href="/ui/tfe.css" type="text/css" media="screen">
<link rel="stylesheet" href="/ui/home.css" type="text/css" media="screen">
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric" href="/eric/thoughts/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric (only technical posts)" href="/eric/thoughts/category/tech/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric (only personal posts)" href="/eric/thoughts/category/personal/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Distractions" href="/eric/thoughts/recent-links/rss2" />
<link rel="alternate" type="application/rss+xml" title="Excuse of the Day" href="/feeds/excuse/rss20.xml" />
</head>
<body id="www-meyerweb-com" class="hpg">

<div id="sitemast"><h1><a href="/"><span>meyerweb</span>.com</a></h1></div><div id="search"><h4>Exploration</h4><!-- SiteSearch Google --><form method="get" action="http://www.google.com/custom" target="_top"><div><input type="hidden" name="domains" value="meyerweb.com"></input><label for="sbb" style="display: none">Submit search form</label><input type="submit" name="sa" value="Google Search" id="sbb"></input><label for="sbi" style="display: none">Enter your search terms</label><input type="text" name="q" size="31" maxlength="255" value="" id="sbi"></input><p><input type="radio" name="sitesearch" value="meyerweb.com" checked id="ss1"></input><label for="ss1" title="Search meyerweb.com">meyerweb.com</label><input type="radio" name="sitesearch" value="" id="ss0"></input><label for="ss0" title="Search the Web">Web</label></p><input type="hidden" name="client" value="pub-3772084027748653"></input><input type="hidden" name="forid" value="1"></input><input type="hidden" name="ie" value="ISO-8859-1"></input><input type="hidden" name="oe" value="ISO-8859-1"></input><input type="hidden" name="safe" value="active"></input><input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1"></input><input type="hidden" name="hl" value="en"></input></div></form><!-- SiteSearch Google --><!-- <form method="get" action="http://www.google.com/custom"><div><input type="submit" name="sa" value="Search"><input type="text" name="q" size="20" maxlength="255" value=""><input type="hidden" name="sitesearch" value="meyerweb.com"></div></form><small><a href="http://www.google.com/search">Powered by Google</a></small> --></div><div id="main"><div class="skipper">Skip to: <a href="#extra">site navigation/presentation</a></div><div class="skipper">Skip to: <a href="#thoughts">Thoughts From Eric</a></div>
<div id="thoughts">


<div class="entry">
<h3><a href="http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/" rel="bookmark" title="Permanent Link: Ordering the Link States">Ordering the Link States</a></h3>
<ul class="meta">
<li class="date">Mon 4 Jun 2007</li>
<li class="time">2125</li>
<li class="cat"><a href="http://meyerweb.com/eric/thoughts/category/tech/css/" title="View all posts in CSS" rel="category tag">CSS</a></li>
<li class="cmt"><a href="http://meyerweb.com/eric/thoughts/2007/06/04/ordering-the-link-states/#comments">21 responses</a></li>
<li></li><li></li></ul>

<div class="text">
<p>
Spend any time at all writing above-beginner CSS, and you&#8217;re going to come across the &#8220;link-visited-hover-active&#8221; (LVHA) rule.  This holds that the four link states should always be listed in that order, like so:
</p>
<pre>
a:link {color: blue;}
a:visited {color: purple;}
a:hover {color: red;}
a:active {color: yellow;}
</pre>
<p>
Masters of the dark arts of specificity know why this rule exists and how it does or doesn&#8217;t apply, but if you&#8217;re still a padawan in these matters (or just rusty), you can get a quick refresher from <a href="http://www.meyerweb.com/eric/css/link-specificity.html">this old chestnut of mine</a>.
</p>
<p>
Now, it&#8217;s the case that this will become less of an issue over time becuase IE7 supports (and one presumes future versions of IE will continue to support) chained pseudo-classes, like <code>a:link:hover {color: red;}</code>.  Once you start chaining those you transcend a lot of the specificity-ordering concerns that drive the LVHA rule.  However, we&#8217;re not there yet.
</p>
<p>
Which brings me to the point of all this: the fifth possible link state, <code>:focus</code>.  Assuming we&#8217;re going to avoid chaining pseudo-classes for a while yet, but that we want to introduce link-focus styles, where should it fit in the ordering?  For the purposes of this discussion, assume the following:
</p>
<pre>
a:focus {color: orange;}

a:link {color: blue;}
a:visited {color: purple;}
a:hover {color: red;}
a:active {color: yellow;}
</pre>
<p>
We need to move the <code>a:focus</code> rule so it has a visible effect.  But where?  Should it come before <code>a:hover</code>, after <code>a:hover</code>, or after <code>a:active</code>?  In other words, which states&#8217; styles should the focus style overwrite?
</p>
<p>
I&#8217;d like to hear your thoughts on the matter, and especially the rationale driving your answer.  Accessibility experts are particularly welcome to weigh in, but it&#8217;s anyone&#8217;s game here.
</p>
<p>
(Postscript: I know that many problems can be avoided by picking a different styling effect for the focus style, like a border or outline, or boldfacing or italicizing the text of a focused link.  Still, some people will want to handle everything through color, regardless of the problems this can cause for the colorblind or images-as-links, and I&#8217;d like to address that specific situation.  Thanks.)
</p>
</div>

</div>

</div>
<p style="font-size: 90%; text-align: right; margin-top: 0.5em; padding-top: 0;">(If you care, there's even an <a href="/eric/thoughts/page/2/">archive of previous thoughts</a>...)</p>

</div><div id="extra"><div class="panel" id="archipelago"><h4>Identity Archipelago</h4><ul><li><a href="http://flickr.com/photos/meyerweb/" rel="me">Flickr</a></li><li><a href="http://twitter.com/meyerweb/" rel="me">Twitter</a></li><li><a href="http://dopplr.com/traveller/meyerweb">Dopplr</a></li><li><a href="http://www.linkedin.com/in/meyerweb" rel="me">LinkedIn</a></li><li><a href="http://technorati.com/profile/emeyer" rel="me">Technorati</a></li></ul></div><div class="panel" id="pointers"><h4>Projects Elsewhere</h4><ul><li><a href="http://aneventapart.com/">An Event Apart</a></li><li><a href="http://complexspiral.com/">Complex Spiral Consulting</a></li><li><a href="http://www.webassist.com/go/css/emeyer/">CSS Sculptor</a></li><li><a href="http://css-discuss.org/">css-discuss</a></li><li><a href="http://microformats.org/">Microformats</a></li><li><a href="http://s5project.org/">S5</a></li></ul></div><div class="panel" id="tour"><ul><li><a href="http://fray.com/issue3/"><img src="http://fray.com/images/i3c.gif" alt="Fray Contributor (Issue 3: Sex &amp; Death)" /></a></li><!-- <li><a href="http://www.webassist.com/go/css/emeyer/"><img src="/pix/CS_ad_180x109.jpg" alt="CSS Sculptor for Dreamweaver" style="max-width: 100%;" /></a></li> --></ul></div><div class="panel">
<h4>Recently Tweeted</h4>
<p class="more"><a href="http://twitter.com/meyerweb">see more</a></p>
<p>Coffee shop hacking—using a stir-stick to spread cream cheese on my bagel. <small>&#8211;tweeted 8 hours, 25 minutes ago</small></p>
</div><div id="sideblog" class="panel">
<h4>Distractions</h4>
<p class="more">
<a href="/eric/thoughts/recent-links/">archive</a>
</p>
<ul>
<li><a href="http://tweetagewasteland.com/2010/03/my-head-is-in-the-cloud/" title="March 18 | &#8220;I sense that my addiction to the realtime stream is only making room for the consumption of a faster stream.&#8221;">My Head is in the Cloud</a> <small>[via <a href="http://daringfireball.net/">John</a>]</small></li>
<li><a href="http://8bitnyc.com/" title="March 17 | All of a sudden I want to establish a mission in Central Park and negotiate with the natives for gold and food.">8-Bit NYC</a></li>
<li><a href="http://www.youtube.com/watch?v=nFicqklGuB0&amp;feature=player_embedded" title="March 12 | Wry comment expressing my appreciation of the creative derivativeness of this video and its uncanny accuracy in mocking common tropes.">Academy Award Winning Movie Trailer</a></li>
<li><a href="http://www.youtube.com/watch?v=414TmP12WAU" title="March 9 | &#8220;Apple juice&#8230; for half price!&#8221;  More like twice PRICELESS.  (Note: If you&#8217;re at work, don your headphones.)">Happy in Paraguay</a> <small>[via <a href="http://unstoppablerobotninja.com/">Ethan</a>]</small></li>
<li><a href="http://www.youtube.com/watch?v=9V5ubAOeOBk&amp;feature=player_embedded" title="February 10 | This is approximately the best thing ever.">U900 -Walk Don&#8217;t Run (Isogabamaware)</a></li>
<li><a href="http://www.456bereastreet.com/archive/201002/sifr_default_css_hides_content_from_at_least_one_screen_reader/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A 456bereastreet %28456 Berea Street%29" title="February 8 | -9999px comes through again, but I really wish we were beyond that kind of thing.">sIFR default CSS hides content from at least one screen reader</a></li>
<li><a href="http://www.macosxhints.com/article.php?story=20100117064356428" title="February 8 | Storing this for future use.">Take a picture with the iSight camera when a folder is opened</a></li>
<li><a href="http://mingle2.com/blog/view/web-developer-mind" title="February 4 | Mostly valid.  (SEE WHAT I DID THERE?)">The Mind of a Web Developer: An Illustrated Diagram</a></li>
<li><a href="http://www.theonion.com/content/news/science_channel_refuses_to_dumb" title="January 28 | &#8220;Punkin Chunkin, for Christ&#8217;s sake&#8230; What more do you people want?&#8221;">Science Channel Refuses To Dumb Down Science Any Further</a></li>
<li><a href="http://www.mailchimp.com/blog/project-omnivore-declassified/" title="January 27 | Sounds like quite a feat.  But I wonder how we&#8217;d feel if Microsoft or Google announced the same kind of thing on their e-mail services.">MailChimp&#8217;s Project Omnivore: Declassified</a></li>
<li><a href="http://www.politifact.com/truth-o-meter/statements/2010/jan/25/carolyn-maloney/congresswoman-says-democratic-presidents-create-mo/" title="January 26 | &#8220;Obviously, luck matters a lot, but when there is a consistent pattern over more than 60 years, it starts to look like more than just luck.&#8221;">Congresswoman says Democratic presidents create more private-sector jobs</a></li>
<li><a href="http://www.ted.com/talks/taylor_mali_what_teachers_make.html" title="January 25 | Truth.">Taylor Mali: What teachers make</a></li>
<li><a href="http://notebook.johnmartz.com/how-websites-work?c=1" title="January 22 | At last, the truth is out and I can stop pretending:  beatific monkeys are what makes it all go.">How websites work</a></li>
</ul>
</div>
<div class="panel" id="advisory">
<div class="guarded">
<a href="http://blogadvisorysystem.com/"><img src="/pix/bas/guarded.png" alt="Blog Advisory System Alert Level: Guarded"></a>
</div>
</div>

<div class="panel" id="excuse">
<h4>The <a href="/feeds/excuse/">excuse of the day</a> is</h4>
<p>neutrino interactions</p>
</div>

<div class="panel" id="extras">
<h4>Extras</h4>
<ul>
<li><a href="/feeds/">Feeds</a> &#8226;</li>
<li><a href="/eric/faq.html">FAQ</a> &#8226;</li>
<li><a href="/family.html">Family</a></li>
</ul>
</div>

</div>

<div id="navigate">
<h4>Navigation</h4>
<ul id="navlinks">
<li id="archLink"><a href="/eric/thoughts/">Archives</a></li>
<li id="cssLink"><a href="/eric/css/">CSS</a></li>
<li id="toolsLink"><a href="/eric/tools/">Toolbox</a></li>
<li id="writeLink"><a href="/eric/writing.html">Writing</a></li>
<li id="speakLink"><a href="/eric/talks/">Speaking</a></li>
<li id="otherLink"><a href="/other/">Leftovers</a></li>
<li id="aboutsite"><a href="/ui/about.html">About this site</a></li>
</ul>
</div>

<div id="footer">
<p class="sosumi">All contents of this site, unless otherwise noted, are &copy;1995-2008 <strong>Eric A. and Kathryn S. Meyer</strong>.  All Rights Reserved.</p>
<p>"<a href="/eric/thoughts/">Thoughts From Eric</a>" is powered by the &uuml;bercool <a href="http://wordpress.org/">WordPress</a></p>
</div>
</body>
</html>
