Horje
Explain the difference between head Tag and header Tag in HTML5 ?

The <head> element is a container for metadata and is placed between the <html> and <body> tags. The <header> is for the main content section’s introductory elements, like headings or logos and it mainly focuses on what appears at the top of the webpage.

<head> Element

The <head> element is part of the HTML document’s structure, and it contains metadata and resources that are crucial for the document but not directly displayed on the page. For instance:

  • Meta information (e.g., charset, viewport).
  • Title of the document (<title>).
  • Links to external stylesheets (<link>).
  • JavaScript includes (<script>).
  • Metadata for search engines (<meta>)

Syntax

<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width,
initial-scale=1.0">
<title>Document Title</title>
</head>

<header> Element

The <header> element is a semantic HTML5 element that is used to define the header section of a document or a section within a document. It usually contains introductory content, headings, logos, navigation menus, or other elements related to the introduction of the document or a specific section. For instance:

  • Page title or logo.
  • Navigation menus.
  • Headings or introductory text.

Syntax

<header>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</header>



Reffered: https://www.geeksforgeeks.org


HTML

Related
HTML Table Borders HTML Table Borders
Browser Object Model Browser Object Model
HTML Link Colors HTML Link Colors
HTML Head Element HTML Head Element
HTML &lt;search&gt; Tag HTML &lt;search&gt; Tag

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
17