I will make my considerations about <section>
and <article>
based on some sources where I will take part of the content.
SECTION
The HTML element <section>
represents a generic section contained in an HTML document, usually with a title, when there is no more specific semantic element to represent it.
Usage notes
- Each
<section>
should be identified, usually including a heading (element <h1>-<h6>
) as a child of the element <section>
.
- If it makes sense to distribute the contents of an element separately, use an element
<article>
in his stead.
- Do not use the element
<section>
as a container generic; for that purpose <div>
serves, especially when the section is for styling purposes only. A rule of thumb is when a section should logically appear in the structure of a document.
Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/section
You can use a Section to define areas or regions for:
Introductory texts
Listings
Maps
Commentary
Contact information
Etc....
ARTICLE
The HTML Article Element (<article>
) represents an independent composition in a document, page, application, or website, or which is intended to be distributed independently or reusable, for example in syndication. This could be a forum post, a magazine or newspaper article, a blog post, a comment sent by a user, a gadget or widget interactive, or any other form of independent content.
Usage notes
- When an element
<article>
is nested, the inner element represents an item related to the outer element. For example, blog post comments can be elements <article>
nestled in <article>
representing the blog post.
- Information about the author of an element
<article>
can be provided through the <address>
, but it does not apply to <article>
nested.
- The date and time of publication of an item
<article>
can be described using the attribute pubdate of a single element <time>
.
Usually you use a heading
within the article
and tb may be advisable to use a footer
also.
Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article
You can use a Section to define areas or regions for:
Lamppost in Foruns
Blog Entries
Articles
Etc...
What is observed is that you can separate for example a set of articles
in a section
, and in each of these articles
you may have other sections
inside. That’s why I think you got a little confused. Different from the element <main>
for example, that it is not advisable to have more than one per document, or set it within a article
. Source
Structure model built with semantic tags:
Example of "nonsemantic structure" verses "semantic structure"
Source: https://www.vikingcodeschool.com/html5-and-css3/html5-semantic-tags
OBS: According to this article on Estruturas Semaânticas and Mozilla Accessibility
There are currently no known implementations of the structure algorithm in graphical browsers or user agents
of assistive technology, although the algorithm is implemented in other software as in compliance checkers. Thus, the structure algorithm cannot be trusted to deliver the document structure to users. Authors are advised to use header levels (H1-H6) to transmit the document structure.
Source: https://developer.mozilla.org/en-US/docs/Sections_and_Outlines_of_an_HTML5_document
Article I recommend reading: https://internetingishard.com/html-and-css/semantic-html/
Practical example
In this example will be at the discretion of the team define the scope and understanding of how it should be interpreted semantically "Mission, Vision and Values". If each part works alone or if the message only works together.
If you understand that the "Mission, Vision and Values" belong to the same context, and it would not make sense, for example, to use only the Values insolate form in other parts of the site, I suggest you use a article
mounted as below:
<article>
<h2>Missão, Visão e Valores</h2>
<section>
<h3>Missão</h3>
<p>Lorem ipsum dolor sit amet.</p>
</section>
<section>
<h3>Visão</h3>
<p>Lorem ipsum dolor sit amet.</p>
</section>
<section>
<h3>Valores</h3>
<p>Lorem ipsum dolor sit amet.</p>
</section>
</article>
Already if you believe that it is fully possible to use only the Mission in a certain part of the page and that even insolada it would pass the message properly and does not depend on Vision and Values you can separate "Mission, Vision and Values" into articles
within a section
, for the article
works independently without depending on the rest of the content around.
<section>
<h2>Missão, Visão e Valores</h2>
<article>
<h3>Missão</h3>
<p>Lorem ipsum dolor sit amet.</p>
</article>
<article>
<h3>Visão</h3>
<p>Lorem ipsum dolor sit amet.</p>
</article>
<article>
<h3>Valores</h3>
<p>Lorem ipsum dolor sit amet.</p>
</article>
</section>
A basic rule: if I extract this element from its context, will it still make sense? If so, everything indicates that it is a
<article>
, if not, it may be a<section>
. A chapter of a book, for example, would lose its meaning, as it is strongly associated with the context of the rest of the story - it would be a<section>
; a blog post is usually independent of other posts and makes sense even outside the context of the site - it would be a<article>
.– Woss