使用 HTML 进行语义标记、定义列表或使用 div 进行有序 lsit?

发布于 2024-11-17 02:06:04 字数 534 浏览 4 评论 0原文

我正在创建一个网站,我将在其中使用水平手风琴。 我发现两个 jquery 插件可以满足我的需求。

  1. http://www.madeincima.eu/blog/jquery-plugin-easy-手风琴/
  2. http://nicolahibbert.com/demo/liteAccordion/

他们似乎都做了我需要的一切。然而,第二个使用有序列表,而第一个使用定义列表。哪一个在语义上更正确?这甚至是一个容易处理的问题,还是取决于我如何使用手风琴?

手风琴中的每张幻灯片都有一个标题,并且该幻灯片的内容将根据标题展开。虽然它没有完全定义标题,但它与标题非常相关。

鉴于此,您认为哪个版本更好?

谢谢

I'm creating a website where I'm going to be using a horizontal accordion.
I've found two jquery plugins that do what I want.

  1. http://www.madeincima.eu/blog/jquery-plugin-easy-accordion/
  2. http://nicolahibbert.com/demo/liteAccordion/

They both seem to do everything I need. The second one however uses ordered lists, while the first one uses a definition list. Which one is more semantically correct? Is this even a tractable problem, or will it depend on exactly how I'm using the accordion?

Each slide in the accordion will have a title, and the content of that slide will be expanding upon the title. While it isn't exactly defining the title, it will be very related to it.

Given this, which version do you think is better?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

染年凉城似染瑾 2024-11-24 02:06:04

我想说,有序列表将具有更多语义含义,因为您没有定义稍后在内容中使用的术语。

I would say an ordered list would have more semantic meaning, as you are not defining terms to be used later on in your content.

写给空气的情书 2024-11-24 02:06:04

这最终取决于您使用这些插件之一的内容。从语义上讲,如果手风琴有一些不相关的内容,则使用定义列表将利用语义定义术语(手风琴元素的可单击标题)作为其后续内容。

然而,如果所有内容都是相关的,从技术上讲,在语义上使用无序列表可以更清楚地详细说明所有内容都收集为一个列表,没有任何单个内容的定义与其他内容不同。

It will ultimately depend on the content for which you employ one of these plugins. Semantically speaking, if you have somewhat unrelated content for the accordion, the use of the definition list will make use of semantically defining the term (the accordion element's clickable title) as its following content.

However if all of the content is related, technically using an unordered list semantically could detail more clearly that all of the content is collect as one list with no single piece being defined differently than any other.

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