Introduction to HTML
Published on October 1, 2026
HTML is used to structure web pages.
Clear, interactive, and structured HTML lessons designed for beginners.
The HTML <header> element represents introductory
content for a page or a specific section. It commonly contains headings,
logos, navigation-related content, introductory text, or other
information related to the beginning of a content area.
<header> element is a semantic element.
It describes the role of the content instead of simply acting as a
generic container.
The <header> element defines introductory content
for a document, page, section, or article.
<header>
<h1>My Website</h1>
<p>Welcome to my website</p>
</header>
Welcome to my website
The main purpose of <header> is to identify
introductory or navigational content associated with a page or section.
A header may contain:
<header>
<h1>CIIT Training Institute</h1>
<p>
Technology Training and Learning
</p>
</header>
Technology Training and Learning
A page header can contain a navigation area.
In that case, the navigation itself should normally be represented
using the <nav> element.
<header>
<h1>Learning Portal</h1>
<nav>
<a href="#">Home</a>
<a href="#">Courses</a>
<a href="#">Contact</a>
</nav>
</header>
A header can contain a logo or branding information.
<header>
<img src="logo.png"
alt="Company Logo">
<h1>My Company</h1>
</header>
A complete page can have a top-level header introducing the website.
<body>
<header>
<h1>My Learning Website</h1>
<p>
Learn web development step by step.
</p>
</header>
<main>
Main Content
</main>
</body>
A <header> can also be used inside an
<article> to introduce that article.
<article>
<header>
<h2>Introduction to HTML</h2>
<p>
Published on October 1, 2026
</p>
</header>
<p>
HTML is used to structure web pages.
</p>
</article>
Published on October 1, 2026
HTML is used to structure web pages.
A section can have its own header when the section needs introductory or heading-related content.
<section>
<header>
<h2>HTML Forms</h2>
<p>
Learn how to create HTML forms.
</p>
</header>
<form>
...
</form>
</section>
A header may contain several related elements.
<header>
<img src="logo.png"
alt="Learning Portal Logo">
<h1>Learning Portal</h1>
<p>
Learn HTML, CSS and JavaScript.
</p>
<nav>
<a href="#">Home</a>
<a href="#">Courses</a>
<a href="#">Contact</a>
</nav>
</header>
The <header> element and heading elements such as
<h1> and <h2> are different.
| Element | Purpose |
|---|---|
<header> |
Groups introductory content for a page or section. |
<h1> |
Represents a heading. |
<h2> |
Represents a lower-level heading. |
<h3> |
Represents another heading level. |
A <div> is a generic container, while
<header> communicates that the content is
introductory or header-related.
<!-- Generic container -->
<div>
Website Header
</div>
<!-- Semantic container -->
<header>
Website Header
</header>
<header>
<div>
<h1>CIIT Training Institute</h1>
<p>
Learn industry-ready technical skills.
</p>
</div>
<nav>
<a href="#">Home</a>
<a href="#">Courses</a>
<a href="#">About</a>
<a href="#">Contact</a>
</nav>
</header>
<article>
<header>
<h1>
Learn HTML From Scratch
</h1>
<p>
Author: Training Team
</p>
<p>
Published:
<time datetime="2026-10-01">
October 1, 2026
</time>
</p>
</header>
<p>
HTML provides the structure of a web page.
</p>
</article>
<section>
<header>
<h2>.NET Full Stack Development</h2>
<p>
Learn C#, .NET, SQL, Web API and frontend technologies.
</p>
</header>
<p>
Course content starts here.
</p>
</section>
The page structure should remain meaningful and should avoid unnecessary nesting of the same structural elements.
Instead of unnecessarily placing one header directly inside another, use headers where they represent distinct page or section introductions.
Semantic page structure helps assistive technologies understand the role of different content areas.
A header can provide a clear introductory region for a page or section, especially when used together with appropriate headings and navigation.
A document can have more than one <header> when
different sections or articles have their own introductory content.
<header>
<h1>Learning Portal</h1>
</header>
<main>
<article>
<header>
<h2>HTML Basics</h2>
</header>
<p>
Learn the basics of HTML.
</p>
</article>
<article>
<header>
<h2>HTML Forms</h2>
</header>
<p>
Learn how to create forms.
</p>
</article>
</main>
The <header> element should be chosen because
the content is introductory or header-related, not only because
the area appears at the top of a page.
A header is a structural container, while an
<h1> is a heading.
When content represents a page or section header,
<header> can communicate the purpose more clearly.
<header> for introductory content.<nav> for navigation links.<header> only for styling purposes.Create a website header containing a logo, website title, description, and navigation links.
<header>
<img src="logo.png"
alt="Learning Portal Logo">
<h1>Learning Portal</h1>
<p>
Learn web development step by step.
</p>
<nav>
<a href="#">Home</a>
<a href="#">Courses</a>
<a href="#">Tutorials</a>
<a href="#">Contact</a>
</nav>
</header>
The HTML <header> element represents introductory
content for a page or section. It can contain headings, logos,
introductory text, and navigation. A header is a semantic structural
element and is different from heading elements such as
<h1>, <h2>, and
<h3>.