Confused about semantic HTML5 tags, vs [closed]
Confused about semantic HTML5 tags, <header> vs <div id=“header”> [closed]
I see that there are many ways to create markup on a website. Some use <header> and someone uses <div id = "header">.
<header>
<div id = "header">
Some people use <nav> and others use <div id = "nav">. Some use <main> and other use <body> ...
<nav>
<div id = "nav">
<main>
<body>
What is the ideal markup structure that is HTML5 and SEO friendly?
Please see the attached picture I uploaded... its that correct element structure of a website?

Thanks.
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
Feel free to use <nav> <header> <footer>
– Chase
Aug 28 at 18:31
This question relies heavily on opinion as there is no one "correct" set of markup for a webpage. As such I feel that this question falls into the "bad subjective" category and should be closed as "primarily opinion based". Please spend some time revising it to ask a specific question about code that you're having trouble with. Honestly, you're probably better off spending time following HTML tutorials and reading blog posts to learn more of the basics.
– zzzzBov
Aug 28 at 20:19
Questions like this can be asked on Webmasters.SE
– Machavity
Aug 29 at 15:11
2 Answers
2
Better is to use new html5 tags like header, main, article etc... but you can also use id, class in those tags.
<header class=””></header>
when use nav, class or id?
– Ibrahim Ibo
Aug 28 at 20:14
@IbrahimIbo nav tag should be used for each navigation you would like to create. This is new html5 tag and if you want to use Id do it for single div if something is unique and class when you will use something more times.
– user9683477
Aug 29 at 21:27
You should use Html5 elements (https://www.w3schools.com/html/html5_new_elements.asp) when you can for readability.
For the 'main' element, it's usually go inside the body element as the main site content.
I personally use something like that:
head
body
header
main
...
footer
please look at my example, is that correct structure? i.stack.imgur.com/m4OUI.png
– Ibrahim Ibo
Aug 28 at 20:02
@IbrahimIbo Yes it is. Any problems with my answer?
– Maxime Gélinas
Aug 28 at 23:26
I think, you need to start with a HTML tutorial. Check out the tutorial from w3schools i.e. w3schools.com/html
– dns_nx
Aug 28 at 17:54