There is two ways to make Vertical Menu Bar with Sub-Menu:
. Javascript
. CSS
if u want to make 'vertical menu bar' by using 'CSS'; then go for the given "style codes"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Vertical CSS menu with a Behavior file.</title>
<link href="/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Services</a>
<ul>
<li><a href="#">Webdesign</a></li>
<li><a href="#">Development</a></li>
<li><a href="#">Illustration</a></li>
<li><a href="#">Search engine</a></li>
<li><a href="#">Wordpress</a></li>
</ul>
</li>
<li><a href="#">Blog</a>
<ul>
<li><a href="#">Webdesign</a></li>
<li><a href="#">Development</a></li>
</ul>
</li>
<li><a href="#">Contact</a></li>
</ul>
</body>
</html>
{!--------------------------------Style sheet code-----------------------------}
/*
Title: Vertical CSS menu with a behavior file.
Author: Stefan Vervoort
Blog: http://www.divitodesign.com/blog/
Article: http://www.divitodesign.com/blog/2008/01/vertical-css-menu-with-a-behavior-file/
*/
body {
behavior: url(csshover.htc);
}
a {
color: #000;
text-decoration: none;
}
ul {
list-style: none;
margin: 0;
padding: 0;
width:200px;
}
ul li {
font: bold 11px/16px arial, helvetica, sans-serif;
height:100%;
background:#ff8b8e;
border-bottom:1px solid #fff;
position: relative;
float:left;
width:100%;
}
ul li ul li{
background:#ffcf8b;
}
ul li a{
display:block;
padding: 2px 3px;
}
ul li a:hover {
color: #a00;
background: #ffd3d4;
border-right:1px solid #fff;
border-left:1px solid #fff;
}
ul li ul li a:hover{
background: #ffedd3;
border-left:1px solid #fff;
}
ul ul {
position: absolute;
top: 0;
display:none;
}
ul li:hover ul{
display: block;
left:200px;
}
{----------------------------}
if you have any doubt then use this Url:
www.divitodesign.com/2008/01/vertical-css-menu-with-a-behavior-file/ - 52k
|
My Blog Title
|