HTML 5 – Header Element
The <header> element is the block level
element which I have discussed in my previous article for what is block level
elements.
The <header> HTML 5 element represents
introductory content, typically a group of introductory or navigational aids.
It may contain some heading elements but also a logo, a search form, an author
name, and other elements.
These are the Following Uses of Header
Element
- The header tag contains information related to the title and heading of the related content.
- Main use of <header> in HTML 5 for creating header of websites
- Design Logo, Navigations and Headings thorough header.
- We can use several <header> elements in one document.
- The <header> element is intended to usually contain the section’s heading h1 to h6
- The <header> element can also be used to wrap a section’s table of contents, a search form, or any relevant logos.
- The <header> tag is a HTML5’s tag and it requires a starting tag as well as an end tag.
Syntax
<header> -----
</header>
Example 1.1
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example Header</title>
</head>
<body>
<h1>LOGO NAME</h1>
<a href="">Home</a>
<a href="">About</a>
<a href="">Services</a>
<a href="">Contact</a>
</header>
</html>
Result
Example 1.2
<article>
<header>
<h1>Heading H1 </h1>
<h2>Heading H2 </h2>
<h3>Heading H3 </h3>
<h4>Heading H4 </h4>
<h5>Heading H5 </h5>
<h6>Heading H6 </h6>
<p>Posted by Coders Zilla</p>
<p>Some additional information here</p>
</header>
<p>Lorem
Ipsum dolor set amet....</p>
</article>
Result
Comments
Post a Comment