I'm new to HTML and programming in general and I want to make sure my code is organized and that I'm using the best practices while I go along.
So, I made this example layout I would like to convert to HTML5: https://postimg.org/image/je10syxhz/
And this is the HTML5 code I created:
<!-- Solutions Section -->
<section id="Solutions">
<header>
<h1>Title</h1>
<h2>Subhead</h2>
</header>
<!-- Items -->
<section>
<article class="Solutions_items">
<!-- Should I have a <header> inside each article? -->
<h1>Item 1</h1>
<p>Lorem ipsum...</p>
</article>
<article class="Solutions_items">
<h1>Item 2</h1>
<p>Lorem ipsum...</p>
</article>
<article class="Solutions_items">
<h1>Item 3</h1>
<p>Lorem ipsum...</p>
</article>
</section>
</section>
Now to the question:
Is there a difference between using div
instead of sections
or articles
? I mean, not only in the organization realm but also in optimization realm? Is there a general best practice convention nowadays about this specific topic? Because I feel that using sections
and articles
makes the code easier to read (and also makes the CSS file cleaner).
Thanks! :)