Nav on image
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="STYLESHEET" type="text/css" href="web.css">
<title>web design</title>
</head>
<body>
<h1>Nav on image</h1>
<div class="img">
<div class="container">
<div class="nav">
<a href="#">Home</a>
<a href="#">News</a>
<a href="#">Contact</a>
<a href="#">Aboutus</a>
</div>
</div>
</div>
</body>
</html>
CSS Nav on image Style
.img{
background-image: url(hero.jpg);
min-height:380px;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
}
.container{
position: absolute;
margin:20px;
width: auto;
}
.nav{
overflow: hidden;
background-color: #333;
}
.nav a{
float: left;
color:#f2f2f2;
text-align: center;
padding:14px 16px;
text-decoration: none;
font-size:17px ;
}
.nav a:hover{
background-color:#ddd;
color: #000;
}
No comments:
Post a Comment