请输入您要查询的百科知识:

 

词条 Article element (HTML5)
释义

  1. Features and usage

     Examples  Attributes 

  2. Comparison with <section>

     Nesting examples 

  3. Browser support

  4. References

  5. External links

HTML5 Article is a HTML5 semantic element, similar to {{tag|section|o}} and {{tag|header|o}}. It is most commonly used to contain information that may be distributed independently from the rest of the site or application it appears in.

Features and usage

The HTML5 {{tag|article|o}} element represents a complete composition in a web page or web application that is independently distributable or reusable, e.g. in syndication. 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.[1]

Examples

At its most basic, {{tag|article|o}} can be used to encapsulate a body of text and a corresponding title like so:

Insert Title Here

Insert a paragraph of text here

Forum entries and comments are typically implemented by nesting {{tag|article|o}} tags:

Entry Title

Header Info

Content of entry...

Author: John Smith

Comment Info

Comment text...

Author: Jane Johnson

2nd Comment's Info

Comment text...

Attributes

The {{tag|article|o}} element only includes the global HTML attributes such as contenteditable, id, and title.[2] However, pubdate, an optional boolean attribute of the {{tag|time|o}} element, is often used in conjunction with {{tag|article|o}}. If present, it indicates that the {{tag|time|o}} element is the date the {{tag|article|o}} was published. Note that pubdate applies only to the parent {{tag|article|o}} element, or to the document as a whole.[3]

Comparison with <section>

HTML5 introduced both {{tag|article|o}} and {{tag|section|o}}. Both are semantic tags, defining sections in a document, such as chapters, headers, footers[4] but the {{tag|article|o}} element is effectively a specialized kind of {{tag|section|o}} has a more specific meaning, referring to an independent, self-contained block of related content.[3][5]

Nesting examples

To better organize independent content {{tag|section|o}} tags can be nested inside {{tag|article|o}} tags:

Names of Shapes

There are several different types of shapes...

Triangles

Here is some info about triangles

Circles

These Pi-shaped wonders are mesmerizing and...

Conversely, it may sometime be appropriate to nest an {{tag|article|o}} element inside a {{tag|section|o}} element. For example, in a web page containing several articles on varying subjects:

Articles about Paris Tourism

The Eiffel Tower

Standing at over 12 inches high...

The Louvre

A must-see in Paris tourism...

Browser support

The following browsers have support for this element:[6]

  • Desktop
    • Google Chrome 5.0 and higher
    • Firefox 4.0 and higher
    • Internet Explorer 9.0 and higher
    • Safari 4.1 and higher
    • Opera 11.1 and higher
  • Mobile
    • Android 2.2 and higher
    • Firefox Mobile (Gecko) 4.0 and higher
    • IE Mobile 9.0 and higher
    • Safari Mobile 5.0 and higher
    • Opera Mobile 11.0 and higher

References

1. ^{{cite web|url=http://www.w3.org/TR/html5/sections.html#the-article-element |title=HTML5 article element - W3C |publisher=W3.org |date= |accessdate=2014-05-08}}
2. ^{{Cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article|title=The Article Contents element|last=|first=|date=|website=MDN Web Docs|language=en-US|archive-url=|archive-date=|dead-url=|access-date=2018-07-09}}
3. ^{{Cite web|url=http://html5doctor.com/the-article-element/|title=The article element|last=|first=|date=|website=html5doctor.com|language=en|archive-url=|archive-date=|dead-url=|access-date=2018-07-09}}
4. ^{{cite web |url=https://www.w3schools.com/tags/tag_section.asp |title=The section tag |website=W3Schools |date=2014-04-30 |accessdate=2014-05-08}}{{unreliable source?|date=May 2014}}
5. ^{{cite web |url=http://www.iandevlin.com/blog/2011/04/html5/html5-section-or-article |title=HTML5: Section or Article? |website=Iandevlin.com |date=2013-08-19 |accessdate=2014-05-08}}
6. ^{{Cite web|url=http://caniuse.com/#search=article|title=Can I use... Support tables for HTML5, CSS3, etc|website=caniuse.com|language=en-US|access-date=2018-07-09}}

External links

  • [https://designgrande.com/best-rich-snippets-wordpress-plugins/ Rich Snippet Wordpress Plugins]

2 : HTML5|HTML tags

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/26 4:17:49