nav tag Navigation Menu
<nav> tag
The
<nav> tag can create navigation menus on web pages. It is a semantic and block-level
HTML element.
Navigation
menu provides users with an easy and attractive way to access web pages.
Example:
<html>
<head>
<title>simple
navigation</title></head>
<body>
<div style="width:100%;
height:80px;background-color:gray; float:left"></div>
<div style="width:100%;
height:30px;background-color:pink;float:left">
<nav>
<a
href="#">HOME</a>
<a href="#">ABOUT
US</a>
<a
href="#">CONTACT</a>
</nav>
</div>
</body>
</html>
OUTPUT
Example
<html>
<head>
<title>formated navigation</title>
<style>
*{
margin:0px;
padding:0px;
}
.d1{
width:100%;
height:90px;
float:left;
background-image:linear-gradient(#ff0022,#f45,#ff0022);
}
h1{
text-align:center;
}
.d2{
width:100%;
height:40px;
float:left;
background-color:#ffaa22;
position:relative;
}
nav{
float:right;
}
li{
margin:3px;
width:120px;
height:30px;
float:left;
border:1px solid white;
line-height:30px;
list-style:none;
text-align:center;
border-radius:10px;
background-image:linear-gradient(#ff0022,#f45,#ff0022);
z-index:5;
display:block;
}
ul{
background-image:linear-gradient(#ff0022,#f45,#ff0022);
margin:3px;
padding:0px;
}
a{
text-decoration:none;
display:block;
}
a:hover{
background-color:red;
border-radius:10px;
color:#aaff22;
display:block;
}
.d3{
height:700px;
width:100%;
float:left;
background-image:linear-gradient(#fea,#ff5,#aff);
}
ul li ul li{
margin:0px;
padding:0px;
position:relative;
z-index:5;
float:none;
display:none;
position:relative;
}
ul li:hover > ul li {
display:block;
}
</style>
</head>
<body>
<div class ="d1"><h1>Bright Academe</div>
<div class="d2">
<nav>
<ul>
<li><a href="#">HOME</a></li>
<li><a href="#">ABOUT US</a>
<ul>
<li><a href="#">TT</a></li>
<li><a href="#">TD</a></li>
</ul></li>
<li><a href="#">CONTACT</a></li></ul>
</nav>
</div>
<div class ="d3"></div>
</body>
</html>
OUTPUT
Comments
Post a Comment