Back to Top

Navigation Bar using HTML and Internal CSS

Navigation Bar -1

In this post, I have created a Navigation Bar of a website using simple HTML and internal CSS. Source Code are following

Source Code:

<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Website</title>
<style>
.nav{
background-color: black;
}
.item {
list-style-type: none;
display: inline;
}

.items {
background-color: black;
margin: 0;
height: 34px;
padding: 34px ;
width: 50%;
margin-left: auto;
}

a {
margin: 0 10px;
text-decoration: none;
text-transform: capitalize;
letter-spacing: 2px;
font-size: 1.5vw;
color:white;
}

a:hover {
background-color:green;
font-size: 1.5em;
}

a:active {
font-size: 1.5em;
}
</style>
</head>

<body>
<div class="header">
<div class="nav">
<ul class="items">
<li class="item"><a href="">Home</a></li>
<li class="item"><a href="">About Us</a></li>
<li class="item"><a href="">Service</a></li>
<li class="item"><a href="">Gallery</a></li>
<li class="item"><a href="">Contact Us</a></li>
</ul>
</div>
</div>

</body>
</html>

Navigation Bar -2





Another Navigation Bar with the image  using Simple HTML and Internal CSS. Source codes are the following.
 
<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
body {font-family: Arial, Helvetica, sans-serif;}
.navbar {
width: 100%;
background-color: #555;
overflow: auto;
}

.navbar a {
float: left;
padding: 12px;
color: white;
text-decoration: none;
font-size: 17px;
}

.navbar a:hover {
background-color: #000;
}

.active {
background-color: #4CAF50;
}

@media screen and (max-width: 500px) {
.navbar a {
float: none;
display: block;
}
}
</style>
<body>
<div class="navbar">
<a class="active" href="#"><i class="fa fa-fw fa-home"></i> Home</a>
<a href="#"><i class="fa fa-fw fa-search"></i> Search</a>
<a href="#"><i class="fa fa-fw fa-envelope"></i> Contact</a>
<a href="#"><i class="fa fa-fw fa-user"></i> Login</a>
</div>

</body>
</html>

0comments

Post a Comment