NavBar

Sunday, 21 January 2018

How to create navigation bar with background color

how to create navigation bar with background color

In the above image navigation bar have background color.In this navigation bar hover effect is also enable in that if mouse is over on text then back ground is change.
here is full code of above navigation bar.

backnav.html

<html>
<head>
<style type="text/css">
.nav{
overflow:hidden;
background-color:gray;
}

.nav a{
float:left;
display:block;
color:#f2f2f2;
text-align:center;
padding:14px 16px;
text-decoration:none;
float-size:17px;
}
.nav a:hover{
background-color:red;
color:white;
}
</style>
<body>
<div class="nav">
<a href="#">HOME</a>
<a href="#">ABOUT US</a>
<a href="#">HELP</a>
<a href="#">CONTACT US</a>
</div>
</body>
</head>

</html>

No comments:

Post a Comment