What is the best way to semantically structure a FAQ?
I am wondering how I sh开发者_开发知识库ould structure a FAQ to keep the semantic meaning of the content.
I think of using defintion list, as the close relation between a question and an anwser may have together.
What are your thoughts about this?
Yes, I prefer to use a definition list.
Your other options are to use headings (h2 etc) for the questions, and paragraphs for the answers, or to put them in a table with a column for the question and a column for the answer.
I would lean towards definition lists not only because of the close question/answer relationship but because they are "cleaner" to break up into sections than either of the other options (use multiple dls with h2's at the start of each) and they are a lot easier to style than tables! In fact, I tend to avoid tables for data relationships with only two fields anyway.
You can even have multiple p-tags in an answer and the document will still validate (I just checked a dl-based FAQ I wrote myself and it validates as XHTML 1.0 Transitional).
精彩评论