Friday, May 09, 2008 at 2:02 PM
As a follow-up to my previous posts on accessibility, here are some design recommendations for creating web content that remains usable by the widest possible audience while helping ensure that the content gets indexed and crawled.
Avoid spurious XMLHttpRequests
Pages that enable users to look up information often use XMLHttpRequests to populate the page with additional information after the page has loaded. When using this pattern, ensure that your initial page has useful information on it -- otherwise Googlebot as well as those users who have disabled scripting in their browser may believe that your site contains only the message "loading..."
CSS sprites and navigation links
Having meaningful text to go with navigational links is equally important for Googlebot as well as users who cannot perceive the meaning of an image. While designing the look and feel of navigational links on your site, you may have chosen to go with images that function as links, e.g., by placing <img> tags within <a> elements. That design enables you to place the descriptive text as an alt attribute on the <img> tag.
But what if you've switched to using CSS sprites to optimize page loading? It's still possible to include that all-important descriptive text when applying CSS sprites; for a possible solution, see how the Google logo and the various nav-links at the bottom of the Google Results page are coded. In brief, we placed the descriptive text right under the CSS-sprited image.
Google search results with CSS enabled

Google search result with CSS disabled ("Google" sprited image lost, descriptive "Google" link remains)

Use unobtrusive JavaScript
We've talked about the concept of progressive enhancement when creating a rich, interactive site. As you add features, also use unobtrusive JavaScript techniques for creating JavaScript-powered web pages that degrade gracefully. These techniques ensure that your content remains accessible by the widest possible user base without the need to sacrifice the more interactive features of Web 2.0 applications.
Make printer-friendly versions easily available
Web sites with highly interactive visual designs often provide all of the content for a given story as a printer-friendly version. Generated from the same content as the interactive version, these are an excellent source of high-quality content for both the Googlebot as well as visually impaired users unable to experience all of the interactive features of a web site. But all too often, these printer-friendly versions remain hidden behind scripted links of the form:
<a href="#" onclick="javascript:print(...)
Creating actual URLs for these printer-friendly versions and linking to them via plain HTML anchors will vastly improve the quality of content that gets crawled.
<a href="http://example.com/page1-printer-friendly.html" target="_blank">Print</a>
If you're especially worried about duplicate content from the interactive and printer-friendly version, then you may want to pick a preferred version of the content and submit a Sitemap containing the preferred URL as well as try to internally link to this version. This can help Google disambiguate if we see pieces of the article show up on different URLs.
Create URLs for your useful content
As a webmaster, you have the power to mint URLs for all of the useful content that you are publishing. Exercising this power is what makes the web spin. Creating URLs for every valuable nugget you publish, and linking to them via plain old HTML hyperlinks will ensure that:
- Googlebot learns about that content,
- users can find that content,
- and users can bookmark it for returning later.


15 comments:
Thank you for all these info. I have to update my site with these very useful hints.
Hope you will also let us how to rename filenames of images that were already indexed by google. I mean what should we do to minimize the negative impact of renaming images.
Is there also a limit to the text that we can place in the "ALT" attribute of the image?
Would be better to suggest the usage of CSS-based print-friendly versions.
You can use the very same HTML but applying a different stylesheet, in which you can disable menus and other elements that make no sense on paper. Just use the media="print" attribute in your head link.
cake search: just as with ordinary HTML pages: use an HTTP permanent redirect header.
Yes!
Thank you Google... helping make it more clear on what is 'safe' in regards to links and hiding content!
Side comments...
1) One of your examples for printer friendly pages/links suggests the use of
target="_blank"
This may want to be looked at, as it's not a recommended practice.
2) You mention duplication and the printer friendly pages... then mention the use of Sitemaps.
Does this mean that sitemaps can be used to help point out 'prefered index' content/urls... and any duplications of those pages/contents would not cause problems?
Those aside... more please :D
It's great to see that Google is willing to help clear some of the 'smoke' (replace with choice words) that some SEO companies and people put out.
It will help make some webdesigners/siteowners feel a bit safer!
Keep it up.
Oh, I took that to mean using robots directives wisely to drive indexing.
For instance the printable version of a page may be disallowed in robots.txt, and/or may have a noindex meta tag on it, and/or the html link to it may have rel="nofollow". All this together with not including it in the sitemap.
While it may be possible and indeed preferable to manage the print version of a page through css targeted at the "print" media, it's just possible that at times one wants the content to be somewhat different and perhaps include other items, while excluding some. I'm sure there's always a good reason for this. It's also sometimes easier to control as a separate file, though it may mean maintaining 2 files actually. It depends on circumstances.
I can think of a case where the print version may need to have its own page: when the screen version spans several actual urls. You may want to have only one print version combining all of them, with appropriate pagination.
The ideas are fine and laudible. I would question the use of "Design Pattern"? Its not exactly design pattern(s), as it is a set of sensible guidelines.
kind regards,
Joel
What about adding "title" attribute to links. Will it help?
As Joel noted that title of this post caused somewhat of a letdown. I hesitate to link to a Y! resource but I was expecting something closer in spirit to this: http://developer.yahoo.com/ypatterns/
In fact I wish the Y! patterns had more advice on accessibility issues than they currently do (occasionally there is nothing at all.)
Regardless of this linguistic difference, T.V. Raman is well respected in the web community for his guidance on accessibility matters - thanks for documenting these insights.
@Autocrat:
"Does this mean that sitemaps can be used to help point out 'prefered index' content/urls... and any duplications of those pages/contents would not cause problems?"
"Yes" to the first part, "not necessarily" to the second. Check out our Sitemaps FAQs post (3rd-to-last question) for details.
That is very helpful information. Thanks a ton. I will definately take this advice and apply it to my webiste.
Thanks
Garrett Fuller
Free4thofJulyRecipes.com
In the section sub-titled "CSS sprites and navigation links" you mention one technique that uses an empty span tag to accomplish the image replacement. I try not to put extra mark-up for presentation in my
html, so I use the famous "text-indent:-9999px" to achieve the effect. Is there a reason that I should change my stylesheets and mark-up to use the technique with the span?
P.S. and there is also the padding technique.
Enjoyed the post - there is a way to configure your links that are both bot friendly and let you utilize the JavaScript to open a pop up (these are also user friendly for those that have turned JS off): use an href AND an onclick event with a return false
href="/content/pressReleases/05-22-08.html" onclick="javascript:OPW('/content/pressReleases/05-22-08.html','popupWindow4');return false" target="_blank" close tag
Where OPW is the function for opening the pop-up.
Don’t use inline events – use unobtrusive JavaScript.
See: http://en.wikipedia.org/wiki/Unobtrusive_Javascript
I don't know if this is the correct spot to post this comment, but has anyone had a problem such as this problem which I encounter all the time: I have to reset my password almost every time to log into my email even though I reset it to the same old password I've always used?
After it happens six more times I'm going to just hit reset my password each time instead of trying to log in and having to type those letters, each and every time just to end up resetting it each and every time....!!
Hi everyone,
Since some time has passed since we published this post, we're closing the comments to help us focus on the work ahead. If you still have a question or comment you'd like to discuss, free to visit and/or post your topic in our Webmaster Help Forum.
Thanks and take care,
The Webmaster Central Team
Post a Comment