just wondering, is it bad practice to place a <header>
tag inside a div tag when designing a site that mostly uses html5
elements and the doctype is for html5? Thanks!
Also, should I place the Nav
outside the header or inside, or does it really matter?
No, as long as you respect the content semantics and that your header contains header information. You can wrap it in a div with no SEO drawbacks.
Because the header of a page is part of the body of the page, just as the footer. Think about this <body> as a human body: Head, middle of the body and the feet. A page has the same concept: Header (is the head), section (middle of the body), and footer (the feet).
The <header> tag in HTML is used to define the header for a document or a section as it contains the information related to the title and heading of the related content. The <header> element is intended to usually contain the section's heading (an h1-h6 element or an <hgroup> element), but this is not required.
Header element and accessibility The <header> element specified at the top of your HTML - the one closest to our <body> element - is always interpreted as the introduction of the webpage.
I do not believe that it is a bad practice. However, still make sure you have it placed int the general area where it should be.
Here is a link that might help you understand the location of your header.
No, as long as you respect the content semantics and that your header contains header information. You can wrap it in a div with no SEO drawbacks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With