<?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>CSS Wizardry &#187; Accessibility</title>
	<atom:link href="http://csswizardry.com/tag/accessibility/feed/" rel="self" type="application/rss+xml" />
	<link>http://csswizardry.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 16 May 2012 12:57:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Styling alt text on images</title>
		<link>http://csswizardry.com/2011/06/styling-alt-text-on-images/</link>
		<comments>http://csswizardry.com/2011/06/styling-alt-text-on-images/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 17:41:39 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=2870</guid>
		<description><![CDATA[I tweeted a tip the other day whereby you add text styles to images so that their alt text is differentiated if images, for whatever reason, cannot be loaded.
The tweet sparked more interest than I expected so I thought I would give the technique a more thorough writeup. The CSS is incredibly simple but it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/csswizardry/status/81748007304962048">I tweeted a tip</a> the other day whereby you add text styles to images so that their <code>alt</code> text is differentiated if images, for whatever reason, cannot be loaded.</p>
<p>The tweet sparked more interest than I expected so I thought I would give the technique a more thorough writeup. The CSS is incredibly simple but it&#8217;s just one of those things that can make a lot of difference to someone&#8217;s UX.</p>
<p>The thinking is that by applying text-styles to images you can affect their <code>alt</code> text and how that appears if the image fails to load. This can help users realise there&#8217;s something different about a piece of content and that it&#8217;s perhaps not directly a part of the current text.</p>
<p>A lot of people weren&#8217;t aware this would or does work but if you think about it, any <code>alt</code> text you&#8217;ve ever seen will have been the same face, colour and style as the rest of the page. <code>alt</code> text (and therefore images) can be styled!</p>
<h2>The code</h2>
<p>I started doing this a long, long time ago but for some reason completely forgot about it until I started developing <a href="http://inuitcss.com">inuit.css</a>.</p>
<p>I tend to always apply italics to the text and oftentimes a text colour. Italics is fairly failsafe as figures and asides etc are often set in italics.</p>
<p>Text colours can be more troublesome as it could be misconstrued as being a link, so use this wisely and avoid using the same colour as your links appear in.</p>
<p>Another fairly progressive (but potentially unstable) addition is to use the <code>:after</code> pseudo-element to append the text &#8216;(image)&#8217; onto the <code>alt</code> text. This only seems to work in Firefox (4).</p>
<p>The code, in full, is simply:</p>
<pre><code>img{
    font-style:italic;
    color:#c00;
}

<span class="code-comment">/*
In Firefox we can insert the word (image) into the alt text of an image that hasn’t loaded.
*/</span>
img:after   { content:&quot; (image)&quot;; }
img::after  { content:&quot; (image)&quot;; } <span class="code-comment">/* New CSS3 standard notation */</span></code></pre>
<p>So there we have it, a simple, tiny addition to make your users&#8217; experience a little more polished and complete&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2011/06/styling-alt-text-on-images/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Mark up a semantic, accessible, progressively enhanced, mobile optimised progress bar (bonus: style the numbers in an ordered list!)</title>
		<link>http://csswizardry.com/2010/11/mark-up-a-semantic-accessible-progressively-enhanced-mobile-optimised-progress-bar-bonus-style-the-numbers-in-an-ordered-list/</link>
		<comments>http://csswizardry.com/2010/11/mark-up-a-semantic-accessible-progressively-enhanced-mobile-optimised-progress-bar-bonus-style-the-numbers-in-an-ordered-list/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 18:27:32 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Markup]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Progressive Enhancement]]></category>
		<category><![CDATA[Semantics]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=1711</guid>
		<description><![CDATA[How about that for an over-the-top title? But it&#8217;s true, that&#8217;s what we&#8217;re going to be doing. It&#8217;s been a while since my last post, unfortunately, so I thought I&#8217;d make up for it with this sizeable offering in which we will learn a lot of really great techniques in order to make something as [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>H</span>ow</span> about that for an over-the-top title? But it&#8217;s true, that&#8217;s what we&#8217;re going to be doing. It&#8217;s been a while since my last post, unfortunately, so I thought I&#8217;d make up for it with this sizeable offering in which we will learn a lot of really great techniques in order to make something as simple as a progress bar. By which I mean a breadcrumb-esque meter of steps, such as you might find on a checkout process; we are making <a href="/demos/progress-bar/">this</a>:</p>
<p><a href="/demos/progress-bar/" style="background:none;"><img src="http://csswizardry.com/wp-content/uploads/2010/11/progress.jpg" alt="Screenshot of the final product." class="full" /></a></p>
<p><span id="more-1711"></span></p>
<p>And in doing so we will cover:</p>
<ul>
<li><a href="#section-design-build">Design and build a semantic, accessible and sensible progress bar.</a></li>
<li><a href="#section-body-id">Utilise the much underused method of styling page-specific elements based on their IDs.</a></li>
<li><a href="#section-numbers">Style the numbers in an ordered list!</a></li>
<li><a href="#section-progressive">Progressively enhance it with some CSS3.</a></li>
<li><a href="#section-mobile">Optimise it for mobile.</a></li>
</ul>
<p class="marginalia"><strong>N.B.</strong> This article isn&#8217;t so much about a progress bar, but more an illustration that best practices and more advanced techniques can be applied to even the most insignificant aspects of a build to create something awesome!</p>
<h2 id="section-design-build">Design and build</h2>
<p>Let us assume the brief is this:</p>
<p>We require a numbered progress bar to indicate user location (past, current and future) during a checkout path on the OurService&trade; website. It must:</p>
<ul>
<li>Be fully accessible.</li>
<li>Provide a section title with supporting information.</li>
<li>Highlight the user&#8217;s current location in the process.</li>
<li>Be navigable.</li>
<li>Work on mobile devices.</li>
</ul>
<p>The design, let&#8217;s assume, is predefined. It looks as above, purely because it has to. The design is not the major focus of this article, the code and techniques are.</p>
<blockquote><p>&#8220;Code what you consume, not what you see.&#8221;</p>
</blockquote>
<h3>Design</h3>
<p>The progress bar shall be a linear, left to right series of linked labels. Current location shall be indicated by a change in colour, progression onto the next step shall be indicated by an arrow.</p>
<h3>Build</h3>
<p class="marginalia">For the purposes of this tutorial we shall assume the current page is the payment page.</p>
<p>One school of though I find invaluable when it comes to sensible and semantic builds is <q>code what you consume, not what you see</q>. This is a very broad generalisation but works for the most part. Code content independently of (and before you consider) coding any styles. Web development basics, but fundamental to web standards and progressive enhancement.</p>
<p>So, what are we consuming? It&#8217;s an ordered list of steps which indicate location in a process.</p>
<p>Okay so first off we know we need an <code>&lt;ol&gt;</code> as this list has fixed and definite order. We also require titles and supporting copy for each item. As the titles and supporting copy require separation from one another we are going to wrap the titles in a <code>&lt;span&gt;</code>; a generic inline container. This leaves us with:</p>
<pre><code>&lt;body id=&quot;payment-page&quot;&gt;

  &lt;ol id=&quot;progress&quot;&gt;

    &lt;li class=&quot;details-step&quot;&gt;
      &lt;a href=&quot;#&quot;&gt;
        &lt;span&gt;Your details&lt;/span&gt;
        Name, email, address.
      &lt;/a&gt;
    &lt;/li&gt;

    &lt;li class=&quot;account-step&quot;&gt;
      &lt;a href=&quot;#&quot;&gt;
        &lt;span&gt;Create account&lt;/span&gt;
        Username and custom URL.
      &lt;/a&gt;
    &lt;/li&gt;

    &lt;li class=&quot;products-step&quot;&gt;
      &lt;a href=&quot;#&quot;&gt;
        &lt;span&gt;Product options&lt;/span&gt;
        Choose your package.
      &lt;/a&gt;
    &lt;/li&gt;

    &lt;li class=&quot;payment-step&quot;&gt;
      &lt;a href=&quot;#&quot;&gt;
        &lt;strong&gt;
          &lt;span&gt;Payment&lt;/span&gt;
          PayPal, or credit card.
        &lt;/strong&gt;
      &lt;/a&gt;
    &lt;/li&gt;

    &lt;li class=&quot;go-step&quot;&gt;
      &lt;a href=&quot;#&quot;&gt;
        &lt;span&gt;Go!&lt;/span&gt;
        Start using OurService&trade;
      &lt;/a&gt;
    &lt;/li&gt;

  &lt;/ol&gt;

&lt;/body&gt;</code></pre>
<p>There are a few things in this code which I&#8217;ve not yet mentioned, one is the ID on the <code>&lt;body&gt;</code>, another being the class on each <code>&lt;li&gt;</code> and the last being the <code>&lt;strong&gt;</code> wrapped around the payment page&#8217;s text. I shall explain these next.</p>
<h4 id="section-body-id"><code>&lt;body&gt;</code> ID and list item classes</h4>
<p>A combination of an ID on the <code>&lt;body&gt;</code> and a class on a list item can allow you to know what the current page is. The CSS <code>#payment-page .payment-step{}</code> will target the payment section of the progress bar when it is on the payment page in the process. Similarly, <code>#go-page .go-step{}</code> will target the go item on the go page. I wrote <a href="http://www.venturelab.co.uk/devblog/2010/06/body-idsmaking-life-easier-for-yourself/">a much more in-depth article</a> on this over at <a href="http://www.venturelab.co.uk/">Venturelab</a>.</p>
<h4>The <code>&lt;strong&gt;</code> around the payment step&#8217;s text</h4>
<p class="marginalia">If you&#8217;re determining current page programatically, one could argue inserting a <code>class=&quot;current&quot;</code> on the relevant item. This is doable, but avoiding such a class name is far nicer.</p>
<p>As stated earlier we are assuming the current page to be the payment page. Now, we can style the current step on any page using CSS, as outlined above, however how would a user with styles disabled be able to tell what the current page is? How can we highlight this for those users?</p>
<p>Well the solution would be to programatically wrap a <code>&lt;strong&gt;</code> around the text on that page, undo the bolding effects with CSS for browsers with styles enabled, and allow people viewing unstyled content to see that the bolded item is the current page. This gives us:</p>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/11/progress-unstyled.jpg" alt="Unstyled progress bar" class="left outdent" /></p>
<p>As you can see, users with styles disabled can clearly see the current link is the bolded one, this makes the progress bar that little bit more  accessible to those who might need it.</p>
<p>So there we have it, the markup that powers the whole thing.</p>
<div class="hr">
<hr /></div>
<h2>Styling</h2>
<p>Now to style this thing up. First off we&#8217;ll look at the very basic CSS, and that alone:</p>
<pre><code><span class="code-comment">/*------------------------------------*\
  MAIN
\*------------------------------------*/</span>
html{
  height:101%;
}
body{
  font-family:Calibri, Arial, Verdana, sans-serif;
  background:#fff;
  color:#88979e;
  width:940px;
  padding:10px;
  margin:0 auto;
}

<span class="code-comment">/*------------------------------------*\
  PROGRESS
\*------------------------------------*/</span>
#progress{
  list-style:none; <span class="code-comment">/* Remove the bullets */</span>
  float:left; <span class="code-comment">/* Make its width equal to the combined width of the items inside it */</span>
  margin-bottom:20px;
}
#progress li{
  float:left; <span class="code-comment">/* Stack them all up left */</span>
  font-size:0.75em; <span class="code-comment">/* Make the entire item smaller */</span>
  font-style:italic; <span class="code-comment">/* Make the entire item italic */</span>
}
#progress a{
  display:block;
  text-decoration:none;
  padding:10px 25px 10px 10px; <span class="code-comment">/* Padding to accomodate background image */</span>
  background:#7b8d77;
  color:#fff;
}
#progress span{
  font-size:1.333em; <span class="code-comment">/* Bring the size of the title only back up */</span>
  font-weight:bold;
  display:block;
  font-style:normal; <span class="code-comment">/* Undo the italics */</span>
}
#progress strong{
  font-weight:normal; <span class="code-comment">/* Remove the bolding for CSS enabled browsers */</span>
}
#progress a:hover{
  text-decoration:none;
}
#progress a:hover span{
  text-decoration:underline; <span class="code-comment">/* Underline the title on hover */</span>
}
#details-page .details-step a,
#account-page .account-step a,
#products-page .products-step a,
#payment-page .payment-step a{
  background:url(../img/css/splitter.gif) right center no-repeat #a49d4d; <span class="code-comment">/* Arrow image on the current step */</span>
}
#go-page .go-step a{
  background:#a49d4d; <span class="code-comment">/* Arrow image not needed on final step, colour only */</span>
}</code></pre>
<p>All of the above is very obvious, it is essentially just like creating a normal navigational menu, and gives us this:</p>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/11/progress-basic.jpg" alt="Basic progress bar" class="full" /></p>
<h2 id="section-numbers">Styling numbers in ordered lists</h2>
<p>Next up we style the numbers in the ordered list by using the very very useful and much unknown CSS counter module. Because you have such limited control over the appearance of your bullets in (ordered) lists they can be a pain to style. This pain is alleviated somewhat when using an unordered list as you can simply use a background image. It is an altogether different story when you&#8217;re using an ordered list as the bullet needs to change with each list item.</p>
<p>What we do here is use CSS to do a very prog-like job; we get it to loop through each item in a parent container and then increment a user-defined value each time it encounters a specified child. Sounds Greek? <a href="http://www.impressivewebs.com/css-counter-increment/" title="Excellent article on CSS counters">Read this</a>.</p>
<p>Once we have this number available to us we use the CSS <code>:before</code> pseudo-element and the <code>content:;</code> property to insert the number before each item. How cool is that?!</p>
<pre><code><span class="code-comment">/*------------------------------------*\
  PROGRESS
\*------------------------------------*/</span>
#progress{
  list-style:none;
  float:left;
  margin-bottom:20px;
  counter-reset:step; <span class="code-comment">/* Set up name of increment on parent */</span>
}
#progress li{
  float:left;
  font-size:0.75em;
  font-style:italic;
}
#progress a{
  display:block;
  text-decoration:none;
  padding:10px 25px 10px 30px; <span class="code-comment">/* Padding changed to 30px to accomodate number */</span>
  background:#7b8d77;
  color:#fff;
  position:relative; <span class="code-comment">/* Relative position to allow absolute positioning later on */</span>
}
#progress span{
  font-size:1.333em;
  font-weight:bold;
  display:block;
  font-style:normal;
}
#progress strong{
  font-weight:normal
}
#progress a:hover{
  text-decoration:none;
}
#progress a:hover span{
  text-decoration:underline;
}
#progress li a:before{
  counter-increment:step; <span class="code-comment">/* Increment the step on each occurance of this (pesudo) element */</span>
  content:counter(step); <span class="code-comment">/* Write out value of the increment */</span>
  text-align:center;
  font-weight:bold;
  position:absolute; <span class="code-comment">/* Position number */</span>
  top:50%;
  left:5px;
  margin-top:-8px;
}
#details-page .details-step a,
#account-page .account-step a,
#products-page .products-step a,
#payment-page .payment-step a{
  background:url(../img/css/splitter.gif) right center no-repeat #a49d4d;
}
#go-page .go-step a{
  background:#a49d4d;
}</code></pre>
<p>This then gives us this:</p>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/11/no-css3-progress.jpg" alt="Non-CSS3 progress bar" class="full"  /></p>
<div class="hr">
<hr /></div>
<h2 id="section-progressive">Progressively enhancing</h2>
<p>Now for the CSS3 progressive bits:</p>
<pre><code><span class="code-comment">/*------------------------------------*\
  PROGRESS
\*------------------------------------*/</span>
#progress{
  background:#7b8d77; <span class="code-comment">/* Give the ol a background to prevent white showing through behind the items' round corners (change value to #f00 to see what I mean) */</span>
}
#progress{
  -moz-border-radius:5px;<span class="code-comment">/* Round all corners of the progress bar */</span>
  -webkit-border-radius:5px;
  border-radius:5px;
}
#progress a{
  text-shadow:1px 1px 1px rgba(0,0,0,0.25); <span class="code-comment">/* A small text-shadow */</span>
  -moz-border-radius:5px 0 0 5px; <span class="code-comment">/* Round the top- and bottom-left corners */</span>
  -webkit-border-radius:5px 0 0 5px;
  border-radius:5px 0 0 5px;
}
#details-page .details-step a,
#account-page .account-step a,
#products-page .products-step a,
#payment-page .payment-step a{
  background:url(../img/css/splitter.gif) right center no-repeat #a49d4d;
}
#progress .go-step a{
  -moz-border-radius:5px; <span class="code-comment">/* Round all corners of the final step */</span>
  -webkit-border-radius:5px;
  border-radius:5px;
}</code></pre>
<p>The full, combined CSS for the progress bar so far is:</p>
<pre><code><span class="code-comment">/*------------------------------------*\
  MAIN
\*------------------------------------*/</span>
html{
  height:101%;
}
body{
  font-family:Calibri, Arial, Verdana, sans-serif;
  background:#fff;
  color:#88979e;
  width:940px;
  padding:10px;
  margin:0 auto;
}

<span class="code-comment">/*------------------------------------*\
  PROGRESS
\*------------------------------------*/</span>
#progress{
  list-style:none;
  background:#7b8d77;
  float:left;
  margin-bottom:20px;
  counter-reset:step;
  -moz-border-radius:5px;
  -webkit-border-radius:5px;
  border-radius:5px;
}
#progress li{
  float:left;
  font-size:0.75em;
  font-style:italic;
}
#progress a{
  display:block;
  text-decoration:none;
  padding:10px 25px 10px 30px;
  background:#7b8d77;
  color:#fff;
  text-shadow:1px 1px 1px rgba(0,0,0,0.25);
  position:relative;
  -moz-border-radius:5px 0 0 5px;
  -webkit-border-radius:5px 0 0 5px;
  border-radius:5px 0 0 5px;
}
#progress span{
  font-size:1.333em;
  font-weight:bold;
  display:block;
  font-style:normal;
}
#progress strong{
  font-weight:normal
}
#progress a:hover{
  text-decoration:none;
}
#progress a:hover span{
  text-decoration:underline;
}

#progress li a:before{
  counter-increment:step;
  content:counter(step);
  text-align:center;
  font-weight:bold;
  position:absolute;
  top:50%;
  left:5px;
  margin-top:-8px;
  padding:2px 6px;
  background:rgba(0,0,0,0.25);

  -moz-border-radius:20px;
  -webkit-border-radius:20px;
  border-radius:20px;
}
#details-page .details-step a,
#account-page .account-step a,
#products-page .products-step a,
#payment-page .payment-step a{
  background:url(../img/css/splitter.gif) right center no-repeat #a49d4d;
}
#go-page .go-step a{
  background:#a49d4d;
}
#progress .go-step a{
  -moz-border-radius:5px;
  -webkit-border-radius:5px;
  border-radius:5px;
}</code></pre>
<p>Which, when coupled with the markup, gives this:</p>
<p><a href="/demos/progress-bar/" style="background:none;"><img src="http://csswizardry.com/wp-content/uploads/2010/11/progress.jpg" alt="Screenshot of the final product." class="full" /></a></p>
<div class="hr">
<hr /></div>
<h3>Recap</h3>
<p>So, let&#8217;s cover what we&#8217;ve done so far. We&#8217;ve:</p>
<ul>
<li>Coded up a semantic progress bar (using an ordered list and correct generic elements).</li>
<li>Made it accessible (addition of the strong around the content for non-CSS browsers).</li>
<li>Styled it all up.</li>
<li>Made use of <a href="http://www.venturelab.co.uk/devblog/2010/06/body-idsmaking-life-easier-for-yourself/">the body ID trick</a> to mark the current page.</li>
<li>Used CSS counters to style the numbers of an ordered list</li>
<li>Progressively enhanced it all to make it a little easier on the eyes.</li>
</ul>
<h2 id="section-mobile">Mobile optimisation</h2>
<p class="marginalia">For more information on mobile/iPhone optimised sites please see <a href="http://csswizardry.com/2010/01/iphone-css-tips-for-building-iphone-websites/" title="iPhone CSS&mdash;tips for building iPhone websites">my associated article</a>.</p>
<p>Next up we need to optimise this thing for mobile. This couldn&#8217;t be simpler. The key to optimising sites for mobile is linearise. Linearise everything.</p>
<p>In your markup, add this line to the <code>&lt;head&gt;</code> section, thus:</p>
<pre><code>&lt;head&gt;
  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
  &lt;title&gt;Progress&lt;/title&gt;
  <strong>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;&quot; /&gt;</strong>
  &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/new-style.css&quot; /&gt;
&lt;/head&gt;</code></pre>
<p>This tells the user agent that the viewport should be the same as the device&#8217;s own screen-size, that it should be initially set to a scale of 1 (i.e. no scale), its maximum scale is set to 1, and that users can&#8217;t scale themselves.</p>
<p>Now, add the following to the very end of your CSS file:</p>
<pre><code><span class="code-comment">/*------------------------------------*\
	MOBILE
\*------------------------------------*/</span>
@media (max-width: 480px){ <span class="code-comment">/* In any browser narrower that 480px... */</span>
body{
	width:auto; <span class="code-comment">/* Give the body a fluid width... */</span>
	padding:5px; <span class="code-comment">/* And a slight padding */</span>
}
#progress{
	width:auto; <span class="code-comment">/* Give the list a fluid width */</span>
	background:none; <span class="code-comment">/* Remove the list's background... */</span>
	float:none; <span class="code-comment">/* ...and float */</span>
}
#progress li{
	float:none; <span class="code-comment">/* Remove list item float, causing them to stack */</span>
	margin-bottom:1px; <span class="code-comment">/* Space them slightly */</span>
}
#progress a{
	margin:0 10px; <span class="code-comment">/* Indent the left and right of each item by 10px */</span>
	-moz-border-radius:5px; <span class="code-comment">/* Round all corners */</span>
	-webkit-border-radius:5px;
	border-radius:5px;
}
#details-page .details-step a,
#account-page .account-step a,
#products-page .products-step a,
#payment-page .payment-step a,
#go-page .go-step a{
	background:#a49d4d; <span class="code-comment">/* Set the background of the current item */</span>
	margin:0 auto; <span class="code-comment">/* Remove the 10px indent to show that the step is current */</span>
}
}</code></pre>
<p>Now, if you want to test this and don&#8217;t have a smartphone, or haven&#8217;t got this hosted in a live environment, simply resize your browser window right down until you see the change. I tend to use the Firefox Web Developer Toolbar addon to <a href="http://csswizardry.com/wp-content/uploads/2010/11/mobile-optimised-progress.jpg">resize the window to 480&#215;800px</a>.</p>
<p>On the iPhone this now looks like:</p>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/11/iphone-progress.jpg" alt="iPhone optimised progress bar" /></p>
<div class="hr">
<hr /></div>
<h2><a href="http://csswizardry.com/demos/progress-bar/">Demo</a></h2>
<p>For the full working demo head to <a href="http://csswizardry.com/demos/progress-bar/">http://csswizardry.com/demos/progress-bar/</a>. For the complete CSS (with reset) please see <a href="http://csswizardry.com/demos/progress-bar/css/style.css">http://csswizardry.com/demos/progress-bar/css/style.css</a>. Also, try using Firebug to change the <code>&lt;body&gt;</code>&#8217;s ID to <code>go-page</code>.</p>
<div class="hr">
<hr /></div>
<h2>Final words</h2>
<p>As I stated previously, this article isn&#8217;t so much about the progress bar itself. What I hope this article has shown is how something as small and trivial as a progress bar has a wealth of little nooks and crannies in which to immerse yourself. Semantics, accessibility, using <code>&lt;body&gt;</code> IDs to style current states without a <code>class=&quot;current&quot;</code>, how to use CSS counters to style the numbers in an ordered list, how to progressively enhance lean markup, and how to optimise things for mobile in a flash.</p>
<p>All of the above skills are easily and quickly transferable. It might be a progress bar today, but what could it be tomorrow? Skills like the ones covered here give you the potential to make something great, out of something very very simple.</p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/11/mark-up-a-semantic-accessible-progressively-enhanced-mobile-optimised-progress-bar-bonus-style-the-numbers-in-an-ordered-list/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Are CSS3 gradients Fool&#8217;s Gold?</title>
		<link>http://csswizardry.com/2010/10/are-css3-gradients-fools-gold/</link>
		<comments>http://csswizardry.com/2010/10/are-css3-gradients-fools-gold/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 15:19:31 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=1700</guid>
		<description><![CDATA[During a discussion debate argument with a developer today I, in a roundabout way, arrived at the question &#8216;are CSS3 gradients Fool&#8217;s Gold?&#8217; The argument itself is somewhat irrelevant and far too long winded to go into here, but the long and short of it was that he was trying to force some crazy CSS3 [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>D</span>uring</span> a <del datetime="2010-10-25T15:17:28+00:00">discussion</del> <del datetime="2010-10-25T15:17:28+00:00">debate</del> <ins datetime="2010-10-25T15:17:28+00:00">argument</ins> with a developer today I, in a roundabout way, arrived at the question &#8216;are CSS3 gradients Fool&#8217;s Gold?&#8217; The argument itself is somewhat irrelevant and far too long winded to go into here, but the long and short of it was that he was trying to force some crazy CSS3 syntax into doing something that only a background image should be used for.</p>
<p>After I had pointed this out to him, one of his arguments was (and I paraphrase) &#8216;if a user disables images I still want them to be able to see it&#8217;.</p>
<p>This astounded me a little, my response was (again, paraphrased) &#8216;If a user wants to disable images then why spoof it? If they want to disable images they don&#8217;t want to be left with something-that-looks-just-like-an-image-but-technically-isn&#8217;t, they want that gone because they opted to disable images!&#8217;</p>
<p>If a user has trouble reading something because of the rainbowey background on it and they choose to disable images to aid contrast, only to find that the rainbow persists, does this not present an accessibility issue?</p>
<p>This then led me onto the thought that, actually, this is the same with all CSS3 gradients. I have been using CSS gradients for some time now, and they&#8217;re live as we speak on several different sites. But are they such a good idea&#8230;?</p>
<p>Now, I am just thinking out loud here, but are they a Fool&#8217;s Gold? Do they present accessibility issues? Or am I over-dramatising and over-thinking things?</p>
<p>Any thoughts or information about this would be great to help get the discussion opened up&#8230;</p>
<h2>Addendum</h2>
<p class="marginalia"><strong>Please read this bit</strong>, I do know how and why they are a good thing, but I&#8217;m not here to talk about that&#8230;</p>
<p>To make clear, I fully understand all the benefits of using CSS gradients, they&#8217;re a fantastic addition to CSS and I can wholeheartedly see why and where they are good (scalability, ease of change etc) however this post focusses entirely on possible drawbacks. I know all about their benefits, I just haven&#8217;t mentioned them here.</p>
<p>Furthermore, the rainbow gradient was a tongue-in-cheek example. It isn&#8217;t however all that far from the truth&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/10/are-css3-gradients-fools-gold/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>In response to &#8216;Invisible captcha to prevent form spam&#8217;</title>
		<link>http://csswizardry.com/2010/10/in-response-to-invisible-captcha-to-prevent-form-spam/</link>
		<comments>http://csswizardry.com/2010/10/in-response-to-invisible-captcha-to-prevent-form-spam/#comments</comments>
		<pubDate>Mon, 04 Oct 2010 16:57:39 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Spam]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=1429</guid>
		<description><![CDATA[I seem to be doing a lot of these types of posts lately&#8212;responses to other articles. Today&#8217;s is about an article pointed out to me by a friend and ex-colleague. The article deals with an interesting new way to combat form spam by hiding a form field from human sight, and working on the premise [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>I</span> seem</span> to be doing a lot of these types of posts lately&mdash;responses to other articles. Today&#8217;s is about an article pointed out to me by a friend and ex-colleague. The article deals with an interesting new way to <a href="http://www.ngenworks.com/blog/invisible_captcha_to_prevent_form_spam/">combat form spam by hiding a form field from human sight</a>, and working on the premise that a spam-bot (devoid of &#8216;human sight&#8217;) will continue to fill this field in, thus identifying it as being spam.</p>
<p>The more astute among you will have already spotted the flaw. Is it just spam-bots that can&#8217;t see? Nope, exactly.</p>
<p>Screen-reader users can&#8217;t see this form field in much the same way a spam-bot can&#8217;t. Their screen-reader will read out the field&#8217;s label and prompt them to fill it in.</p>
<p>The issue here is that humans aren&#8217;t meant to know about this field, and anyone filling it in will flag their submission up (incorrectly) as being spam.</p>
<p>A way round this might be to label the field as &#8216;Hey humans, do not put your email address in here!&#8217; and hope that they&#8217;ll not be too confused by it, but that&#8217;s unlikely because it&#8217;s nothing <em>but</em> confusing. We also have to assume here that not all screen-readers will ignore content with <code>display:none;</code> applied to it.</p>
<p>An interesting idea, but pretty inaccessible to a small minority of users. And users are more important than a lack-of-spam.</p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/10/in-response-to-invisible-captcha-to-prevent-form-spam/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Moving forward is holding us back</title>
		<link>http://csswizardry.com/2010/03/moving-forward-is-holding-us-back/</link>
		<comments>http://csswizardry.com/2010/03/moving-forward-is-holding-us-back/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 22:03:28 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Optimisation]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=840</guid>
		<description><![CDATA[For years, web developers have been looking forward to that next feature, that new and monumental shift which has allowed them to break away from the shackles of obsolescence and adopt new and forward thinking technologies. But it is beginning to come full circle&#8212;that thirst for new technology has slowly brought us back to square [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>F</span>or</span> years, web developers have been looking forward to that next feature, that new and monumental shift which has allowed them to break away from the shackles of obsolescence and adopt new and forward thinking technologies. But it is beginning to come full circle&mdash;that thirst for new technology has slowly brought us back to square one, reimposing the constraints that we have, for years, tried to rid ourselves of. <em>Moving forward is holding us back</em>.</p>
<p><span id="more-840"></span></p>
<p>Okay, okay. That was a very alarmist intro. There is no web developers&#8217; apocalypse around the corner (not that I know of anyway, please don&#8217;t take anything I say about the apocalypse as read. I don&#8217;t want that responsibility.), nor are we going to have to regress to using tables and spacer GIFs again. The real issue here is that with all this new technology that keeps emerging and exciting web developers is unwittingly reimposing the restrictions of yesteryear&#8230;</p>
<h2>Screen resolutions</h2>
<p class="marginalia">Remember trying to break away from 800&#215;600px?</p>
<p>With the movement toward a more mobile web, screen resolutions are in fact getting smaller. The iPhone&#8217;s maximum resolution is 480px, increasingly popular netbooks are set at about 1024px wide. Such a shift toward mobile and portable devices mean that screen sizes are actually getting <em>smaller</em>.</p>
<p>In my opinion, <a href="http://csswizardry.com/2010/01/iphone-css-tips-for-building-iphone-websites/" title="iPhone CSS&mdash;tips for building iPhone websites">iPhones and other mobile devices should be handled separately</a>, serving them device specific CSS. Netbooks on the other hand are still &#8216;desktop&#8217; machines like any other. Their smallness is their key feature, and at 1024px horizontal resolution, they aren&#8217;t that small anyway&#8230;</p>
<p>With <a href="http://960.gs/">the 960 Grid System</a>, and <a href="http://csswizardry.com/type-tips/#tip-09" title="Type Tip nine: Line Length Matters">an optimum line length of 52&ndash;78 characters</a>, sticking to 1024px shouldn&#8217;t be that difficult anyway. I believe that although desktop monitor sizes are generally getting larger, other equally important technologies are creeping up, and as responsible developers you should cater for them. Sure you may want to start adopting <a href="http://sam.brown.tc/entry/379/the-new-massive-blue" title="A post by Sam Brown on the redesign of Massive Blue">the 1080 grid</a>, which is all well and good if you know your audience, but to cater for the majority, we&#8217;re <em>not ready to burst 1024 yet</em>.</p>
<h2>Connection speeds</h2>
<p class="marginalia">Remember building for 56k dial up connections? (I don&#8217;t)</p>
<p>Where permanent and fixed connections are getting much faster, connections to mobile devices through means such as 3G are <em>much</em> slower. The ability to optimise sites to be fast loading over such connections is getting more important. As edge-case resolutions are getting smaller, edge-case connections are getting slower. Much slower.</p>
<h3>A word on Flash</h3>
<p class="marginalia">Remember <a href="http://www.2advanced.com/">2Advanced</a>? A site of yesteryear&#8230;</p>
<p>Flash seems to be dying a death anyway these days, slowly being superseded by Javascript and Canvas <span xml:lang="la" lang="la" title="and others">et al</span>. However, what was once a fantastically powerful technology has been ousted completely from Apple&#8217;s <i>i</i> products, making in an inviable option for content which needs to be universally accessible.</p>
<h3>A real life example?</h3>
<p>Anyone with an iPhone will know what I mean&mdash;spending any amount of time on an iPhone loading poorly optimised sites is a real grind, and via some sensible optimisation these problems can be easily alleviated.</p>
<p>However, a more interesting example might be the one that happened to myself&#8230; When <a href="http://csswizardry.com/2010/01/pastures-newfrom-sense-to-venturelab/" title="Pastures new&mdash;from Sense to Venturelab">we first started at Venturelab</a> we really were building the company from the ground up. For the first few weeks we were without desktop machines <em>and</em> internet. I was working on a 10.1&Prime; netbook with a screen resolution of 1024&#215;600px, and over a poor 3G connection via a dongle.</p>
<blockquote><p>&ldquo;Accessibility isn&#8217;t just about disabilities, it&#8217;s about varying degrees of ability to access content.&rdquo;</p>
</blockquote>
<p>Working in this manner really made me wonder whether enough people are delivering content in a manner which is accessible on numerous levels. Accessibility isn&#8217;t just about disabilities, it&#8217;s about varying degrees of ability to access content. As responsible developers your content should be accessible through a full spectrum of means and in an acceptable manner.</p>
<p>All it takes is some decent optimisation (which is also set to reap SEO benefits) and a reasonable page layout and you&#8217;re already halfway there.</p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/03/moving-forward-is-holding-us-back/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>A suitable alternative&#8212;on proper use of alt attributes</title>
		<link>http://csswizardry.com/2010/01/a-suitable-alternativeon-proper-use-of-alt-attributes/</link>
		<comments>http://csswizardry.com/2010/01/a-suitable-alternativeon-proper-use-of-alt-attributes/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 16:03:03 +0000</pubDate>
		<dc:creator>Harry Roberts</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[Semantics]]></category>

		<guid isPermaLink="false">http://csswizardry.com/?p=318</guid>
		<description><![CDATA[Images in HTML come with a mandatory attribute used to textually describe the information displayed visually through the image. The alt attribute (not tag) is used by screenreaders etc to tell users who can&#8217;t view the actual image what it represents. It is also used in any circumstance where images can&#8217;t be loaded (slow connections, [...]]]></description>
			<content:encoded><![CDATA[<p><span class="opener"><span>I</span>mages</span> in HTML come with a mandatory attribute used to <em>textually</em> describe the information displayed <em>visually</em> through the image. The <code>alt</code> attribute (<a href="http://csswizardry.com/eta" title="A link to a diagram showing the differences between elements, tags and attributes">not tag</a>) is used by screenreaders etc to tell users who can&#8217;t view the actual image what it represents. It is also used in any circumstance where images can&#8217;t be loaded (slow connections, broken URIs etc).</p>
<p><span id="more-318"></span></p>
<h2>When not to use it</h2>
<p class="marginalia">You should never <em>not</em> use an <code>alt</code> attribute, rather leave it empty, thus: <code>alt=""</code></p>
<p>The only time you can really get away with <em>not</em> having a complete <code>alt</code> attribute is if the image holds no context or information that the user needs to be aware of. This is usually the case when the image is purely decorational, though it may be argued that the image should therefore be added through CSS in the spirit of separating style and content. By that token it is fairly safe to say that there should never be an instance in which you leave an <code>alt</code> attribute empty.</p>
<h2>You&#8217;re using it, but not quite right&#8230;</h2>
<p>The next best scenario is that you are using images correctly, for their correct purpose and are using <code>alt</code> attributes, but they don&#8217;t really do as much as they should. A lot of the time I come across images that have less than ideal <code>alt</code> attributes.</p>
<p><img src="http://csswizardry.com/wp-content/uploads/2010/01/car.jpg" alt="A photograph of an abandoned car" width="640" height="393" class="full" /></p>
<p class="marginalia">Image sourced via Google Images&mdash;original author unknown.</p>
<p>One example might be the above image of a car. This, while technically correct, is not ideal: <code>&lt;img src="/img/car.jpg" alt="Car" /&gt;</code>. All this tells the user is &#8216;Car&#8217;. It doesn&#8217;t say whether it&#8217;s a picture with the word car in it, or whether it&#8217;s a picture of a car. A much better <code>alt</code> attribute would be <code>alt="A photograph of an abandoned car"</code> (as used in my code).</p>
<h3>Other poor uses</h3>
<p>Another real-world example of poor <code>alt</code> attribute usage is actually on <a href="http://www.cnn.com/">CNN&#8217;s website</a>. On their home page today (26 January, 2010) they have a series of headlines with accompanying images. The code for such a pairing looks like this:</p>
<pre><code>&lt;img height="68" border="0" width="120" alt="Haiti's swanky club &rarr;
now home to misery" src="http://i.cdn.turner.com/cnn/2010/WORLD/ &rarr;
americas/01/26/haiti.camp/tzvids.haiti.aid.cnn.jpg"&gt; &rarr;
&hellip; Haiti's swanky club now home to misery</code></pre>
<p>This is wrong on two counts:</p>
<ol>
<li>A screenreader will read out to the user <q>Haiti&#8217;s swanky club now home to misery &hellip; Haiti&#8217;s swanky club now home to misery</q>. Every image/headline pairing on the page is laid out like this, meaning in every instance a user using a screenreader will hear the headline twice. This will surely soon get annoying.</li>
<li>Secondly, the image was actually of earthquake survivors holding a large bag, nothing to do with clubs and, unfortunately, far from swanky.</li>
</ol>
<h2>Using the attribute properly</h2>
<p>On the <a href="http://www.bbc.co.uk/">BBC&#8217;s home page</a> however (on the same date) they are using <code>alt</code> attributes perfectly. They have an image of a woman wearing a veil, alongside the article&#8217;s headline <q>France report back face veil ban</q>. The image&#8217;s <code>alt</code> attribute: <code>alt="A woman wears a full-length veil in Lyon, 25 January"</code>.</p>
<h2>The biggest no-no of all</h2>
<p>One thing which consistently winds me up is the ridiculously bad practice of stuffing <code>alt</code> attributes with keywords. <code>alt</code> attributes are an accessibility feature, end of. They are <em>not</em> a way of slipping in keywords out of sight, and any attempt to do so is irresponsible and incredibly bad practice. The only time &#8216;keywords&#8217; may be validly placed in <code>alt</code> attributes is if it&#8217;s explicitly related to the image; for example: <code>&lt;img src="/img/product.jpg" alt="A photograph of Mike's Carpets' ProClean&trade; carpet cleaner" /&gt;</code>.</p>
<h2>How to do it properly</h2>
<p>Writing proper <code>alt</code> text is incredibly simple, yet a little more time consuming than the &#8216;Car&#8217; cop-out. All you need to do is write out in full exactly what the image shows. If it&#8217;s an elephant giving a donkey a piggy-back don&#8217;t be lazy and use <code>alt="Elephant and a donkey"</code>. Instead, write out <code>alt="A photograph of an African elephant giving a donkey a piggy back across a swamp"</code>.</p>
<p>Also, for any pages that use similar images repeatedly but are slightly different to one another, make sure your alt attributes reflect these differences. A good example would be <a href="http://csswizardry.com/portfolio/">my portfolio page</a>. Instead of using <code>alt="Screenshot"</code> over and over again I used text like <code>alt="Screenshot of Suzanna Haworth’s website"</code> and <code>alt="Screenshot of RAAMaudio UK Ltd."</code> etc.</p>
<p>This is one of the most basic aspects of web development, but one that too many people are still getting wrong.</p>
]]></content:encoded>
			<wfw:commentRss>http://csswizardry.com/2010/01/a-suitable-alternativeon-proper-use-of-alt-attributes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

