<header>...</header>
HTML4 HTML5
Defines introductory content or navigation links for a document or specific section (e.g., inside <article>). Typically contains logos, branding, search controls, or heading structures.
Both opening and closing tags are required.
Attributes: Mostly global attributes are used, such as class, id, and style.
Example
Code:
<header style="background-color: #007bff; color: white; padding: 15px; border-radius: 4px;">
<h1 style="margin: 0 0 10px 0; font-size: 1.5em;">My Company Website</h1>
<nav style="background-color: rgba(255, 255, 255, 0.2); padding: 5px 10px; border-radius: 3px;">
<a href="#home" style="color: white; margin-right: 15px; text-decoration: none; font-weight: bold;">Home Page</a>
<a href="#services" style="color: white; margin-right: 15px; text-decoration: none;">Services</a>
<a href="#contact" style="color: white; text-decoration: none;">Contact</a>
</nav>
</header>
The browser will interpret this code as follows: