Create a Responsive Header in HTML and CSS

In today’s new static and dynamic online website, there are lots of the ways you can create a header either it can be a static header which remains the same in all screen sizes as well as a static header is easy to build.

Learn how to create a responsive header with CSS

index.html

<!DOCTYPE html>
<html>
<head>
<title>responsive navbar template</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {box-sizing: border-box;}
nav {
overflow: hidden;
background-color: #330b7c;
padding: 10px;
}
.dev-link-custom {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-weight: bold;
float: left;
color:white;
text-align: center;
padding: 12px;
text-decoration: none;
font-size: 18px;
line-height: 25px;
border-radius: 4px;
}
nav .logo {
font-size: 25px;
font-weight: bold;
}
nav .dev-link-custom:hover {
background-color: rgb(214, 238, 77);
color: rgb(42, 10, 94);
}
nav .selected {
background-color: dodgerblue;
color: white;
}
.driverSidePart {
float: right;
}
@media screen and (max-width: 870px) {
nav .dev-link-custom {
float: none;
display: block;
text-align: left;
}
.driverSidePart {
float: none;
}
}
</style>
</head>
<body>
<nav>
<a class="dev-link-custom logo" href="#">Company Logo/Image</a>
<div class="driverSidePart">
<a class="selected dev-link-custom" href="h">Home</a>
<a class="dev-link-custom" href="#">Contact Us</a>
<a class="dev-link-custom" href="#">About Us</a>
<a class="dev-link-custom" href="#">Products</a>
<a class="dev-link-custom" href="#">Login</a>
</nav>
</body>
</html>

I hope you get an idea about Simple CSS Headers and Footers .


#javascript #css #html 

Create a Responsive Header in HTML and CSS
1.00 GEEK