Introduction
In this blog you will came to know
about The
difference between <article> and <section> tag.
The <article> element is a special type
of <section>. <article >has more specific meaning as compare to <section> that
is, it is independent, self-contained block
of related content.
We
can use <section>, but we mostly use <article> to gives
more specific meaning to the content.
<section> is only a block of related
content, and <div> is only a block of content. Also we here mentioned the pubdate attribute
does not apply in <section>.
The pubdate attribute is used as one
time attribute in <article>.If it is present, it indicates that the
<time> element is the date, the <article> was published. It can be written in
several ways, the most popular being:
pubdate
pubdate="pubdate"
To decide which of three elements is
appropriate, choose the first suitable option:
-
Would the content
would make sense on its own in a feed reader? If so use <article>
-
Is the content
related? if so use <section>
-
Finally if there's
no semantic relationship use <div>
Here is an example of <section>
containing <article>
<h1>Articles
on: Fruit</h1>
<article>
<h2>Apple</h2>
<p>The
apple is the pomaceous fruit of the apple tree...</p>
</article>
<article>
<h2>Orange</h2>
<p>The
orange is a hybrid of ancient cultivated origin, possibly between pomelo and
tangerine...</p>
</article>
<article>
<h2>Banana</h2>
<p>Bananas
come in a variety of sizes and colors when ripe, including yellow, purple, and
red...</p>
</article>
</section>
Output