问题描述
我想知道我应该如何构建 FAQ 以保持内容的语义.
I am wondering how I should 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.
您对此有何看法?
推荐答案
是的,我更喜欢使用定义列表.
Yes, I prefer to use a definition list.
您的其他选择是对问题使用标题(h2 等),对答案使用段落,或者将它们放在一个表格中,其中一栏为问题,一栏为答案.
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.
我倾向于定义列表,不仅是因为问题/答案关系密切,而且因为它们比其他任何一个选项更更干净"地分成多个部分(在每个选项的开头使用多个带有 h2 的 dls)和它们比桌子更容易设计!事实上,我倾向于避免使用只有两个字段的数据关系表.
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.
您甚至可以在一个答案中使用多个 p 标签,并且文档仍然会验证(我刚刚检查了我自己编写的基于 dl 的常见问题解答,它验证为 XHTML 1.0 Transitional).
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).
这篇关于在语义上构建 FAQ 的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!