Recently I went to w3schools New HTML5 Elements and discovered the “section” and “article” tag. My question is when should you use a section, article or div tag and why does the text gets smaller when I use a section and article tag? Like so:
<section><h1>H1 tag in a section tag</h1></section>
<article><h1>H1 tag in an article tag</h1></article>
<h1>H1 tag in nothing</h1>
Copy and paste in to here. (Just putting it there for convenience)
When to use
section:Helpful rules of thumb from Html5doctor:
divarticle,asideornavis more appropriatearticleinstead for syndicated contentWhen to use
article:Use
divwhen no other element can semantically describe it better, or you need a semantically meaningless hook for styling.The reason the
h1s look different is because individual browsers render them differently. You can normalize things across browsers, and deal with default browser style sheets with a css reset.