What is the real difference between the “head” and “header” tag? [duplicate]

强颜欢笑 提交于 2019-11-30 14:52:23
Arena

A quick Google search reveals the following:

Head tag:
The HTML <head> element provides general information (metadata) about the document, including its title and links to/definitions of scripts and style sheets. (HTML MDN)

Header tag:
The HTML <header> element represents a group of introductory or navigational aids. It may contain some heading elements but also other elements like a logo, wrapped section's header, a search form, and so on. (HTML MDN)

-

In other words; the head tag is used for document title, styling, scripts, etc.
Whereas the header tag is used for headers as seen in articles.

Newspaper 'header'

EDIT: Updated reference, as psuedocoder mentioned, W3Schools is not always fully reliable.

pseudocoder

From W3C:

https://www.w3.org/wiki/HTML/Elements/head

"The <head> element represents a collection of metadata for the Document."

https://www.w3.org/wiki/HTML/Elements/header

"The <header> element represents a group of introductory or navigational aids."

The main difference is that the <head> element is for META data and the <header> element is for actual content.

The HTML <head> tag is a container for metadata and links to scripts and stylesheets.

The <header>tag is a semantic container used to designate contents that is introductory or navigational in nature.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!