按日期列出是

发布于 2024-12-06 00:12:24 字数 226 浏览 1 评论 0原文

我有一个这样的时事通讯列表:

  1. 时事通讯 1 月
  2. 时事通讯 2 月
  3. 时事通讯
  4. 3 月时事通讯

我可以按日期对它们进行逻辑排序,但编号实际上并没有任何意义。所以我的问题是什么是语义上正确的?使用

    还是 ul

谢谢。

I have a list of newsletters like this:

  1. Newsletter Jan
  2. Newsletter Feb
  3. Newsletter Mar
  4. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

诗笺 2024-12-13 00:12:25

如果它们按顺序列出,则为

    。尽管我不认为这有什么大不了的。

If they are listed in order, then <OL>. Although I don't think it is a huge deal either way.

九歌凝 2024-12-13 00:12:25

从用户界面的角度来看,没有必要有数字和日期,这只是令人困惑。如果您想对定义非常了解,我想风格适当的 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.

梨涡少年 2024-12-13 00:12:25

从严格的语义意义上来说,任何有顺序的项目列表(包括日期)都应该标记为

    ,因为

      > 标记表示其内容是一个有序列表。

话虽这么说,我同意@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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文