什么时候我们应该使用超过?
- ?
在什么情况下我们应该使用
而不是
?对于屏幕阅读器用户
或
重要吗?屏幕阅读器软件是否通知用户内容位于
或
中?In what scenarios we should go for <dl>
not <ul>
?
Does it matter for screen reader user <ul>
or <dl>
? does screen reader software notify user about content is in <ul>
or <dl>
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是定义列表。它应该用在字典这样的情况下:
用例:
上述结果:
The idea being that the term-to-be-defined is held in the
<dt>
element, and the definition of that term is given in the<dd>
.是一个无序列表。现在,
并不暗示其内容有任何顺序,但它确实暗示其子项之间的语义关系。然而,
可以包含任何未排序的内容。
A
<dl>
is a definition list. It should be used in such a case as, perhaps, a dictionary:Use-case:
Result of the above:
The idea being that the term-to-be-defined is held in the
<dt>
element, and the definition of that term is given in the<dd>
.A
<ul>
is an unordered list. Now, a<dl>
does not imply any order to its contents, but it does imply a semantic relation between its children. A<ul>
, however, could contain anything that is not ordered.当您使用一组定义而不仅仅是无序项目列表时。
When you're working with a set of definitions and not merely an list of unordered items.
对于模棱两可的情况,例如您在乔纳森答案评论中的示例(人名然后描述,问题然后答案),为什么不安装一两个屏幕阅读器的试用版并找出最适合阅读的结构?
(来自此处):
For ambiguous cases like your examples in the comment on Jonathan's answer (person name then description, question then answer), why don't you install a trial version of a screen reader or two and find out which construct is read most appropriately?
Here are two (from here):