About <header> . | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

About <header> .

I don't know why we use <header> tag for <h1> or ... . We can use <h1> tag without <header> tag . What's the <header> ? When we should use this tag ?

23rd Aug 2020, 7:47 PM
Deleted Account
Deleted Account - avatar
2 Answers
+ 1
Header tag is semantic tag introduce with html 5. Semantic tag (header,footer,section,article,aside) are introduced to make code coder friendly. Header is used to define heading section of page which may include navbar ,logo,hero-image... Before html 5 we used div for all that but now we use header and footer ttags in code which helps to understand this this part of code is for heading output and this is for footer output.this was not clear with div as we used varius div for various purposes.
24th Aug 2020, 3:56 AM
Divya Mohan
Divya Mohan - avatar
+ 1
You can use the <h1> outside of your header. The header tag is used to create a clear structure for your site, in the same way as a <nav> or <article> tag.
23rd Aug 2020, 8:59 PM
Charlène Bonnardeaux
Charlène Bonnardeaux - avatar