Saturday , December 5 2020

HTML Header Tag

An HTML Header Tag is a group of introductory content or navigation links. It contains on most important heading tags, <h1> to <h6>, logo, navigation links, and author information etc.

A <header> element may place within the <body> element. You refrain to put it in a <footer>, <address> or <header> element. It is also referred as <header> element.

Syntax:

<header>
.
.
.
</header>

Example of HTML Header Tag:

<!DOCTYPE html> 
<html> 
<head> 
	<meta charset="UTF-8">
	<title>HTML Header Tag</title> 
</head> 
<body> 
<article> 
<header> 
	<h1>This is the heading.</h1> 
	<h3>This is the sub-heading.</h3> 
	<p>This is the metadata.</p> 
</header> 
</article> 
</body> 
</html>

Attributes supported:

Three types of attributes can add to header tag,

  • Global Attributes
  • Event Handler Content Attributes
  • Element Attributes

HTML Header Tag CSS Default Setting:

The header element has the following default CSS value.

header {
	display: block;
}