Im not able to understand the difference between section element vs article element vs div element and where should I use them in my webpage as if in what scenario I should prefer one of the above element over the other.
Hello, @suyash_0007 Welcome to the forums.
<article> are semantic.
Here are the differences:
<section> tag should be used when you are separating a whole section of a webpage.
"More on the <section>" tag.
For example, I might have a webpage on ‘The Brown Bear’(remember this one?). I have three sections-‘About’, ‘Habitat’, and ‘Media’. Each one of those would be contained within a section.
But within each section, I have multiple self-contained
<article>s (they all make sense on their own).
More on the <article> tag.
For example, I may have, in the ‘Habitat’ section, an
<article> tag for ‘Countries with large brown bear populations’ and one for ‘Countries with small brown bear populations’.
<div> Tags are non-semantic, so they can be used in place of any semantic tag.
I hope this helps.
Is there a right or wrong way to decide which to use? For example in the Dasmotos project later in the course. My page and the key were identical in look. The key used
Hello @data0536296466, welcome to the forums! There isn’t exactly a right way to decide, but it you look at the second post, you’ll get a quick run down of when is considered the norm. Another matter that determines how many tags you put in (
div, section, etc), is how many different components you want styled.