Difference Between Article and Section Tag


 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 independentself-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:


 To decide which of  three elements is appropriate, choose the first suitable option:

  1. Would the content would make sense on its own in a feed reader? If so use <article>

  2. Is the content related? if so use <section>

  3. Finally if there's no semantic relationship use <div>

Here is an example of <section> containing <article>

<h1>Articles on: Fruit</h1>
    <p>The apple is the pomaceous fruit of the apple tree...</p>
    <p>The orange is a hybrid of ancient cultivated origin, possibly between pomelo and tangerine...</p>
    <p>Bananas come in a variety of sizes and colors when ripe, including yellow, purple, and red...</p>