Can you tell me what is the difference between <head> and <header> tag in html5? And what is the work of <header> tag. Thanks | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Can you tell me what is the difference between <head> and <header> tag in html5? And what is the work of <header> tag. Thanks

20th Dec 2019, 9:24 AM
Sher Asghar
Sher Asghar - avatar
3 Answers
+ 5
<head> tag use to link CSS file, JavaScript file and to define meta tags but <header> is just like a section which can be put inside body where you can put your navigation tab. See if you make any website then you can devide your page in many panels like header, main body, left panel, right panel and footer.
20th Dec 2019, 9:32 AM
A͢J
A͢J - avatar
+ 2
Thanks brother... 👍
20th Dec 2019, 9:35 AM
Sher Asghar
Sher Asghar - avatar
+ 2
<head> contains metadata content and is older than <header>. Before HTML5 div.header was used as header. But div is just a section without semantics, therefore header, footer, main, article, aside and the other new tags have been added with HTML5 to use instead of divs with the CSS classes.
22nd Dec 2019, 7:18 AM
SergeiRom