简体   繁体   English

什么时候应该使用 <article> 相对于 <ul> ?

[英]When should you use <article> as opposed to <ul>?

What determines whether one should prefer to use <ul> over <article> , or vice versa in a HTML document? 是什么决定了在HTML文档中是应该优先使用<ul>不是<article>还是相反?

As an example I have a portfolio page with a list of items, which would be more appropriate? 例如,我有一个包含项目列表的投资组合页面,哪个更合适?

Element names form part of the semantic web/HTML, so you should use the one you deem most appropriate for your content, MDN is often a good resource to get an overview on what appropriate content may be, some suggestions from which are below. 元素名称是语义Web / HTML的一部分,因此您应该使用最适合您的内容的名称。MDN通常是一种很好的资源,可以概述什么是适当的内容,以下是一些建议。

Lists tend to include shorter, more concise often text only or very image-light content. 列表往往包含更短,更简洁的内容(通常仅是文本)或非常轻的内容。 It sounds like you likely want to look at the section or article tags. 听起来您可能想看一下sectionarticle标签。

Section 部分

The HTML Section Element ( <section> ) represents a generic section of a document, ie, a thematic grouping of content, typically with a heading. HTML Section元素( <section> )表示文档的一般部分,即内容的主题分组,通常带有标题。

Article 文章

The HTML <article> Element represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable, eg, in syndication. HTML <article>元素表示文档,页面,应用程序或站点中的独立组成,旨在独立分发或重用(例如在联合组织中)。 This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content. 这可能是论坛帖子,杂志或报纸文章,博客条目,用户提交的评论,交互式小部件或小工具,或任何其他独立的内容。

List (ul) 清单(ul)

The HTML unordered list element ( <ul> ) represents an unordered list of items, namely a collection of items that do not have a numerical ordering, and their order in the list is meaningless. HTML无序列表元素( <ul> )表示项目的无序列表,即没有数字顺序的项目的集合,并且它们在列表中的顺序是没有意义的。 Typically, unordered-list items are displayed with a bullet, which can be of several forms, like a dot, a circle or a squared. 通常,无序列表项目以项目符号显示,项目符号可以采用多种形式,例如点,圆形或正方形。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM