<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Accessibility Tips &#187; focus</title>
	<atom:link href="http://accessibilitytips.com/tag/focus/feed/" rel="self" type="application/rss+xml" />
	<link>http://accessibilitytips.com</link>
	<description>A collection of tips, guidance and practical suggestions in developing accessible websites</description>
	<lastBuildDate>Sat, 02 May 2009 05:07:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Aiding keyboard usage with :focus cues</title>
		<link>http://accessibilitytips.com/2009/02/09/aiding-keyboard-usage-with-focus-cues/</link>
		<comments>http://accessibilitytips.com/2009/02/09/aiding-keyboard-usage-with-focus-cues/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 16:34:08 +0000</pubDate>
		<dc:creator>Isofarro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[active]]></category>
		<category><![CDATA[aid]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[colour]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[cue]]></category>
		<category><![CDATA[fields]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[movement]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[order]]></category>
		<category><![CDATA[outline]]></category>
		<category><![CDATA[pseudo-class]]></category>
		<category><![CDATA[specificity]]></category>
		<category><![CDATA[visited]]></category>
		<category><![CDATA[visual]]></category>

		<guid isPermaLink="false">http://www.accessibilitytips.com/?p=26</guid>
		<description><![CDATA[Knowing where the keyboard focus is at any time is critical for keyboard users to navigate through and to a particular page. It&#8217;s not only screen reader users who don&#8217;t use a mouse, many disabilities leave the keyboard as the only viable way to interact with a computer whilst still using a monitor. The dotted [...]]]></description>
			<content:encoded><![CDATA[<p>Knowing where the keyboard focus is at any time is critical for keyboard users to navigate through and to a particular page. It&#8217;s not only screen reader users who don&#8217;t use a mouse, many disabilities leave the keyboard as the only viable way to interact with a computer whilst still using a monitor.</p>
<p>The dotted outline on links is the main visual cue to where the current keyboard focus is on a page at any one time. By tabbing or shift-tabbing through the document the focus is set on the next or previous focusable elements.</p>
<p>This focus rectangle is removed because it makes things look unsightly, but they serve a very useful purpose. And that purpose is critical for a keyboard user to find their way through a page.</p>
<p>So it is essential that there is a clear focus indicator, both on links and form fields. Clear enough that a visitor looking at the page for the first time can spot where the keyboard focus is as quickly as possible.</p>
<p>We do this though CSS&#8217; <code>:focus</code> pseudo-class on the target element. For example, to change the background colour of a link when it receives focus we use the following:</p>
<pre><code>
a:focus {
    background-color: #aaf;
}
</code></pre>
<p>We can do the same with input fields:</p>
<pre><code>
input:focus {
    background-color: #aaf;
}
</code></pre>
<p>In each case, the background colour of the focusable element changes colour when it received focus, and that background colour changes back when the element loses focus. By making this background color change enough it is possible for a visitor to find the focused region of the page.</p>
<p>The same argument can also apply to when links are active, using the <code>:active</code> pseudo-class. An active link is one that is in the process of being clicked, so for example when the mouse-button is being held down when over a link and just about to be lifted, this link is seen to be active. Using this active pseudo-class to style an element that is active provides a visible cue about what is going to happen.</p>
<pre><code>
a:active { color: red; }
</code></pre>
<p>And, we often overlook the usefulness of setting a visited link colour (with the <code>:visited</code> pseudo-class). This proves very helpful in distinguishing destinations a visitor has already been to, thus simplifying the choice of which link to try next.</p>
<pre><code>
a:visited { color: purple; }
</code></pre>
<p>A common pitfall is that certain browsers need these pseudo-classes in a specific order so as not to have one pseudo-class override the styles of another. The safest pseudo-class order is <code>:link</code>, <code>:visited</code>, <code>:hover</code>, <code>:focus</code> and then <code>:active</code>:</p>
<pre><code>
a:link { color: blue; }
a:visited { color: purple; }
a:hover { color: magenta; }
a:focus { color: magenta; }
a:active { color: red; }
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://accessibilitytips.com/2009/02/09/aiding-keyboard-usage-with-focus-cues/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Positioning content offscreen</title>
		<link>http://accessibilitytips.com/2008/03/04/positioning-content-offscreen/</link>
		<comments>http://accessibilitytips.com/2008/03/04/positioning-content-offscreen/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 04:52:42 +0000</pubDate>
		<dc:creator>Isofarro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[absolute]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[left]]></category>
		<category><![CDATA[offscreen]]></category>
		<category><![CDATA[position]]></category>
		<category><![CDATA[screenreaders]]></category>
		<category><![CDATA[scroll]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[top]]></category>

		<guid isPermaLink="false">http://www.wp-dev.isolutia.com/?p=6</guid>
		<description><![CDATA[In cases where we need to hide content from a visitor but still make it available to the screenreader, we position it offscreen. The simplest way to do that with CSS is to use the following style: .offscreen { position: absolute; left: -999em; } Avoid offscreen using top A typical mistake is also to set [...]]]></description>
			<content:encoded><![CDATA[<p>In cases where we need to hide content from a visitor but still make it available to the screenreader, we position it offscreen.</p>
<p>The simplest way to do that with CSS is to use the following style:</p>
<pre>
<code>
.offscreen {
    position: absolute;
    left: -999em;
}
</code>
</pre>
<h2>Avoid offscreen using <code>top</code></h2>
<p>A typical mistake is also to set the <code>top</code> property to a negative value in the same style rule. This just about works when the content originally appears at the very top of the page &#8211; like a set of skiplinks.</p>
<p>But, if the content you are hiding is originally below the fold on the screen, when a focusable element in the off-screen styled content receives focus, the page scrolls right to the top of the document trying to bring this content into view. This jump in content creates confusion for keyboard users, and screen magnifier users.</p>
<p>What is just as bad is when the user tabs again, the page again jumps, this time downward to the next focusable element.</p>
<p>When a container of content is positioned offscreen, the focusable elements within still remain in their original tab orders, so they will receive focus as if the content were still in its original place in the document flow.</p>
<p>Offscreen positioning using <code>top</code> interfers with the expectation that focusable content is in a top down order. Offscreen left doesn&#8217;t suffer the same fate because the vertical positioning of the content hasn&#8217;t changed, so no upwards scrolling is required.</p>
<h2>Move focused offscreen content back onscreen</h2>
<p><strong>Note:</strong> When positioning content offscreen which contains focusable elements, you should also ensure that when those focusable elements receive focus that they are brought back into the current viewport. This is necessary so that keyboard users can see the content.</p>
]]></content:encoded>
			<wfw:commentRss>http://accessibilitytips.com/2008/03/04/positioning-content-offscreen/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

