按日期列出是或?
- ?
我有一个这样的时事通讯列表:
- 时事通讯 1 月
- 时事通讯 2 月
- 时事通讯
- 3 月时事通讯
我可以按日期对它们进行逻辑排序,但编号实际上并没有任何意义。所以我的问题是什么是语义上正确的?使用
还是 ul
?谢谢。
I have a list of newsletters like this:
- Newsletter Jan
- Newsletter Feb
- Newsletter Mar
- Newsletter May
I logically order them by date but the numeration does not really mean anything. So my question is what is semantically correct? to use <ol>
or ul
?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果它们按顺序列出,则为
。尽管我不认为这有什么大不了的。
If they are listed in order, then
<OL>
. Although I don't think it is a huge deal either way.从用户界面的角度来看,没有必要有数字和日期,这只是令人困惑。如果您想对定义非常了解,我想风格适当的
ol
会更好。但不要这样做。From a UI perspective, there's no need to have a number and a date, it's just confusing. If you're going to be super anal about definitions though, I guess an appropriately styled
ol
would be better. But don't do that.从严格的语义意义上来说,任何有顺序的项目列表(包括日期)都应该标记为
,因为
> 标记表示其内容是一个有序列表。
话虽这么说,我同意@Dave 的观点,即不太可能需要数字列表指示器(当然取决于您的设计的其余部分),并且可以使用 CSS 隐藏。根据您的目标浏览器,调整边距和/或填充将隐藏它们。
它之所以重要,是因为非可视化浏览器(例如屏幕阅读器或 Lynx 等基于文本的浏览器)可以为用户提供有序列表而非无序列表的附加功能。例如,对于用户来说,跳转到有序列表中的第 8 个项目更有意义,因为他们更有可能根据排序知道该项目是什么,而不是跳转到无序列表中的第 8 项。 (即,他们可以在有序列表上进行二分搜索,但不能在无序列表上进行)
From a strictly semantic sense, any list of items that has an ordering to it (dates included) should be marked up as an
<ol>
, since the<ol>
tag indicates it's contents are an ordered list.That being said, I agree with @Dave that the numeric list indicators are unlikely to be needed (depending on the rest your design, of course), and could be hidden with CSS. Depending on the browsers you are targeting, adjusting the margin and/or padding will hide them.
The reason it matters is because non-visual browsers, such as screen readers or text-based browsers like Lynx can offer their users additional functionality for an ordered list than an unordered one. For example, it makes much more sense for a user to jump to the 8th item in an ordered list, since they are more likely to know what that item is based on ordering, than it does to jump to the 8th item in an unordered list. (ie. they can do a binary search on an ordered list, but not an unordered one)