Navigation bar is a important part of 90% website. using this nav bar we can easily access the whole website easily. Navbar may create We can convert a normal list of HTML into an interactive navigation Bar using little bit CSS code. Here we demonstrate how can we create a simple vertical menu.A simple HTML code to display a list in the browser
<!DOCTYPE html>
<html>
<head><title>Vertical menu Demo</title>
</head>
<body>
<ol>
<li><a href="#">Menu1</a></li>
<li><a href="#">Menu2</a></li>
<li><a href="#">Menu3</a></li>
<li><a href="#">Menu4</a></li>
</ol>
</body>
</html>
This code will generate the following output
Now for display a vertical menu, we use the following code
<!DOCTYPE html>
<html>
<head><title>Vertical menu Demo</title>
<link href="menu.css" rel="stylesheet" type="text/css">
</head>
<body>
<ol class=”vmenu”>
<li><a href="#">Menu1</a></li>
<li><a href="#">Menu2</a></li>
<li><a href="#">Menu3</a></li>
<li><a href="#">Menu4</a></li>
</ol>
</body>
</html>
And write the following code in menu.css file
.vmenu
{
width:100px;
}
.vmenu li
{
display:block;
list-style:none;
padding:15px;
background-color:#ffffcc;
border-style:solid;
border-width:thin;
border-color:#ff0000;
}
.vmenu li a
{
text-decoration:none;
color:#ff0000;
}
.vmenu li a:hover
{
background-color:#000000;
text-transform:uppercase;
color:#ffffff;
}
.vmenu li:hover
{
background-color:#000000;
}