Web Development - Written by Shimone Samuel on Friday, February 15, 2008 16:36 - 4 Comments
Accessible footnotes with HTML and CSS

Having recently set out on the long journey of mastering a new CMS I’ve found myself searching for and stumbling upon1 all manner of plugins, customizations and tweaks for WordPress.
The latest clever addition I found is the use of footnotes. When used properly, footnotes are an appropriate way of commenting on or referencing a portion of text2.
Footnotes serve as a more graceful way to add an aside compared to the long-winded parenthetical. (For instance, here I could give some personal insight into the guilty pleasure of using lengthy digressions, but as you can see, by the time you reach the end of this amusing passage, the original point is confused with a new idea).
So let’s have a look at the requirements for this project:
- A format for referencing footnotes
- A format for displaying footnotes
- A method of moving between the two
- Making your footnotes accessible
A format for referencing footnotes
This first requirement is easy: footnotes are referenced nearly universally with superscript. Deciding what form of superscript to use: number, letter, figure or symbol is entirely up to you. I personally chose numbers.
Fortunately, support for superscript is part of the W3C recommendation for paragraphs, lines and phrases – thereby making it perfectly valid for appropriate use.
In practice, your code may start off looking something like this:
<sup>1</sup>
A format for displaying footnotes
Footnotes are commonly placed at the bottom or “foot” of a page or section. There is no rule stating a footnote cannot go elsewhere, but sticking to traditional conventions is a recommended best practice.
How you choose to style your footnotes is also a personal choice. Perhaps you can peruse your library or book collection to see how it’s been styled elsewhere.
However you choose to style your footnote, using CSS provides the most flexibility to differentiate it from preceding paragraphs.
The resulting code may start off looking something like this:
<div id="footnote"> <ol> <li>Footnote</li> </ol> </div>
By applying an id to the containing div we can cascade the styling of content within. By using an ordered list we retain the continuity of footnotes throughout the page.
A method of moving between the two
Ideally, references should link to their respective footnotes and footnotes should link back to their references. This provides the user with an effortless method of jumping to the footnote and then returning to the passage.
The resulting code may look something like this:
This is some text<sup><a href="#32066" id="fn1">1</a></sup> <div id="footnote"> <li id="32066">This is a footnote <a href="#fn1">↑</a></li> </div>
… and the resulting output may look something like this:
Making your footnotes accessible
For some, the example above may appear perfectly usable. You see a linked number in superscript, click and you’re taken to a footnote. A link in the footnote returns you to the sentence you last read. It doesn’t take much to deduce this just by looking at it.
For those who aren’t looking however the purpose isn’t as clear. Questions arise for those visiting the page with an assistive device such as JAWS: What is this linked number? Where does the link #32066 take me? Once I get there what will I find and how will I get back? Users of JAWS and other assistive devices are simply not seeing a page with the same clarity.
Once again we check the W3C HTML 4.01 specification for a solution and find a fitting one in section 12.1.4: Link Titles.
The title attribute may be set for both A and LINK to add information about the nature of a link. This information may be spoken by a user agent, rendered as a tool tip, cause a change in cursor image, etc.
The resulting code may look something like this:
This is some text<sup><a href="#32066" id="fn1" title="see footnote">1</a></sup> <div id="footnote"> <li id="32066">This is a footnote <a href="#fn1" title="return to article">↑</a></li> </div>
Add a little CSS and the possibilities are endless!
That’s all there is to it. Your methods may vary but this should serve as a good starting point. See below for how we do it here at Like Wow Online.
In a future article we’ll learn how to automate footnote creation with AppleScript. Stay tuned for Part II.. Using AppleScript to create HTML footnotes
- To me, Stumble Upon has become nearly as synonymous a verb as Google and I falter when I see or use the term. In this instance I “stumbled” on Justin Blanton’s Footnotes and TextPander article after seeing footnotes used to great effect on the SmartArchives for Wordpress page.↑
- Footnote as defined in the Answers.com dictionary reference: A note placed at the bottom of a page of a book or manuscript that comments on or cites a reference for a designated part of the text. ↑
4 Comments
ekspekt
I think having all of your “return to article” links saying the same thing might break an accessibility guideline. They all link to different places but say the same thing. How you would name them differently though would be tricky to work out.
Thanks for the feedback Matt. I did encounter that question when I created this and realized – what would I call the links? Aside from naming them differently there wouldn’t be a practical way to name their exact destination (e.g. “return to sentence abc”).
I suppose I could name the href or title cleverly but then automating the creation of footnotes with a CMS would be cumbersome.
Looking at the WCAG 2.0 website I see they use a similar convention for their in-page ‘back’ links: “Go to contents” so I guess this remains the most practical method.
In this case, the “return to article link” returns you to the exact place you left off so clicking a footnote and returning should be seamless even if the title isn’t unique.
Thanks!
Shimone
Max Grabowski
Great article! The only question that I have is:
What do you do when dealing with multiple superscripts to 1 footnote? I see this on several sites that have legal disclosures. You know, the 3 or 4 spots where you see the same asterisk (*). Going from the astersks to the footnote seems easy, but not the trip back.
I can only think of a Javascript solution, where you would use the onClick event to pass the current superscript id to the “back to content” link’s href value.
Leave a Reply
- Secrets to loving your corporate job
- Install a wireless router for your family then email them instructions how to fix it themselves
- Recommended reading from the 2009 Interaction and IA Summit conferences
- Constructive Criticism: Radar for the iPhone
- Shimone.info – A crowdSPRING Success Story
- Generating HTML footnotes with AppleScript and MarsEdit
- Choosing a theme and topics for your blog
- siFR and the user experience
- Accessible footnotes with HTML and CSS
- Creating a blog for fun and profit
- Announcing Like Wow Online!
- Crowdspring is really a blessing for designers who have a tough time finding wor...
- @Ramona - Crowdspring holds the money in an escrow account, the buyer pays up fr...
- Unfortunately, not all stories end well. I won a contest at crowdspring and was...
- This is great! Thank you for the gentle reminder, I love my job and the life I'm...
- Thanks Shimone. Good points there. I would like to share a few, learnt through e...
- This is a brilliantly worded guide to a healthy, sustainable work ethic....
- Fabulous!! I love your insights. It is amazing how simple it could be....
- Great article! The only question that I have is:
What do you do when dealing...
interesting post, will come back here, bookmarked your site