WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Tags to Represent Questions

for

From: Andy Mabbett
Date: Jan 10, 2008 1:00PM


In message
< <EMAIL REMOVED> >, Jared
Smith < <EMAIL REMOVED> > writes

><dl>
><dt>Is this the best way to handle an FAQ question?</dt>
><dd>Probably not, but I can't think of anything better.</dd>
>...
></dl>

This:

<dl>
<dt id="question-1">Is this the best way to handle an FAQ question?</dt>
<dd id="answer-1">Probably not, but I can't think of anything
better.</dd>
<dt id="question-2">Can it be improved?</dt>
<dd id="answer-2">Yes.</dd>
...
</dl>

uses the "id" attribute semantically, and could equally apply to other
elements. You could also add class attributes of "question" and
"answer", too; and add a class of "FAQ" to the DL.

Use two-digit numbers ("01", "02" etc.) if you have more than nine
questions. (If you have more than 99 questions, you have more pressing
problems to consider...)

--
Andy Mabbett
* Say "NO!" to compulsory UK ID Cards: <http://www.no2id.net/>;
* Free Our Data: <http://www.freeourdata.org.uk>;
* Are you using Microformats, yet: <http://microformats.org/>; ?