从语义上构建常见问题解答的最佳方法是什么?
我想知道应该如何构建常见问题解答以保留内容的语义含义。
我考虑使用定义列表,因为问题和答案之间可能存在紧密的关系。
您对此有何看法?
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.
What are your thoughts about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,我更喜欢使用定义列表。
您的其他选择是使用标题(h2 等)作为问题,使用段落作为答案,或者将它们放在一个表格中,其中包含问题列和答案列。
我倾向于定义列表,不仅因为紧密的问题/答案关系,而且因为它们比其他选项更“干净”地分解为多个部分(在每个选项的开头使用多个带有 h2 的 dls),并且它们是比桌子更容易设计样式!事实上,我倾向于避免只包含两个字段的数据关系表。
您甚至可以在答案中包含多个 p 标签,并且文档仍然有效(我刚刚检查了我自己编写的基于 dl 的常见问题解答,它被验证为 XHTML 1.0 Transitional)。
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).