Create a Navbar with Brand Logo using HTML and CSS CODE
<!DOCTYPE html>>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="nav.css">
<title>web design</title>
</head>
<body>
<div class="logo">
<a href="#"><img src="photo.jpg"width="70"></a>
</div>
<nav>
<ul>
<li><a href="#">HOME</a></li>
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">ABOUT-US</a></li>
</ul>
</nav>
</body>
</html>
CSS STYLESHEET CODE
nav{
background-color: black;
width: 100%;
overflow: auto;
}
ul{
list-style-type: none;
padding:0px;
margin-right: 16px;
}
li{
float:left;
}
.logo{
position: absolute;
margin-top: 2px;
}
li a{
width:100px;
display: block;
padding:20px 15px;
text-align: center;
color: #f2f2f2;
text-decoration: none;
}
li a:hover{
background-color: red;
color: #000;
}
No comments:
Post a Comment