Semantic HTML markup for FAQs

Raanan Avidor picture Raanan Avidor · Feb 5, 2009 · Viewed 10.3k times · Source

I want to build a questions and answers page.

It is not a list, it is not tabular data and I am not sure if or how I should use <dl><dt><dd>.

What is the best semantic way to build it and to format it with css?

Answer

Trevor Bramble picture Trevor Bramble · Feb 5, 2009

I always use <dl> for FAQs. Typically making the <dt> an anchor for the index of questions to link.

edit...

I should mention, this is my interpretation of the most semantic approach. As I see it, this is exactly the sort of thing <dl> is meant to mark up.

As for CSS, it's really subjective. I do typical heading-ish styles for the <dt>, with a high font-weight, maybe slightly higher font-size, and maybe greater letter/word spacing.

Whatever integrates well with the rest of your visuals on the site and makes the relationship between the question and answer immediately obvious....