HTML Header tag
Header tag in HTML:
The "header" tag in HTML is used to define the header section of a web web page or a section inside a web page.
It usually includes introductory or navigational content, consisting of emblems, headings, menus, or different elements that seem on the top of a web site.
Example
The "header" tag is like a digital banner.
It's used to mark the top section of a website, which often consists of branding, navigation, or introductory content material.
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome to Our Website</title>
<style>
body {
font-family: 'Arial', sans-serif;
text-align: center;
margin: 0;
padding: 0;
}
header {
background-color: #333;
color: white;
padding: 10px;
}
h1 {
margin: 0;
font-size: 24px;
}
p {
margin: 5px 0;
font-size: 18px;
}
nav {
margin-top: 10px;
}
a {
color: white;
text-decoration: none;
margin: 0 10px;
font-size: 16px;
}
</style>
</head>
<body>
<header>
<h1>Welcome to Our Website</h1>
<p>Discover amazing things here.</p>
<nav>
<a href="#">Home</a>
<a href="#">About Us</a>
<a href="#">Services</a>
<a href="#">Contact</a>
</nav>
</header>
</body>
</html>
Try it Yourself »