When it comes to crafting web sites, we often think of doing things that please search engines such as Google. This has the potential to lead us down a path where we think of Google first and users second. What happens when coding something for better optimization from Google’s perspective clashes with coding something that is better for people with disabilities?
Right around that time I was in Phoenix for the 2010 IA Summit, and on Wednesday in my Real World Accessibility for Ajax and Web Apps workshop, an attendee asked about the issues of speed. At his company they’ve been focussed on speed of service delivery for their web site. To the point where they’ve changed the markup to be leaner. For a navigation menu, instead of using an ordered list, they were using simple links without any other markup.
<ul> <li><a href="page1.html">Page 1</a></li> <li><a href="page2.html">Page 2</a></li> <li><a href="page3.html">Page 3</a></li> <li><a href="page4.html">Page 4</a></li> </ul>
<a href="page1.html">Page 1</a> <a href="page2.html">Page 2</a> <a href="page3.html">Page 3</a> <a href="page4.html">Page 4</a>
For that component alone, that’s roughly a 30% reduction in code. It is faster.
Add in style rules to make the list items display:inline, and include any DOM manipulation or traversal and these differences can add up.
I think most people would agree that the first example with the unordered list is more accessible, and provides more semantic markup. We’ve been coding navigation menus as lists of links for years and you likely have been too, for good reasons:
- a list of links provides more context (we’re on item 2 of 4)
- coding it as a list allows a typical screen reader user to jump from one nav block to the next
- we often use nested lists to denote hierarchy in our navigation (though this example doesn’t)
So, where does this leave us, then?
It seems that at a micro level, speed and basic accessibility (and semantics) are at odds with one another.
I sincerely hope the weight given to site speed isn’t something that overpowers other factors like accessibility. Why? Because site speed is about to be the new big thing that companies focus on in order to try to get to the top of the search results. Thankfully they state: “While site speed is a new signal, it doesn’t carry as much weight as the relevance of a page”
Relevance will always be the most important factor (or at least, it better be). Accessibility and speed are important too, so to me, the best way to approach it will be:
- write/create hightly relevant content
- use semantic markup and ensure your site is as accessible as it can be
- use every means to speed up and optimize after you’ve done everything else.
It doesn’t have to be speed versus accessibility, does it?