HTML header
Created By: chatGPT
In HTML, the header section of a webpage is typically used to contain introductory content or navigational links. It is usually defined within the
<header>
tag, which can include elements like the website's title, logo, and primary navigation menu. The <header>
tag helps convey the structure of the document to browsers and assistive technologies.<header>
<h1>My Website</h1>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="services.html">Services</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</header>
The navigation links are usually organized in an unordered list. This promotes better accessibility and search engine optimization. You can further style the header using CSS to enhance its visual appeal.
<style>
header {
background-color: #f8f9fa;
padding: 20px;
}
h1 {
font-size: 2em;
margin: 0;
}
nav ul {
list-style-type: none;
padding: 0;
}
nav ul li {
display: inline;
margin-right: 20px;
}
</style>