Hello there,
I found this great chunks+css in a topic on this forum for making a drop down menu.
Yet there is still (at least) one problem that I’m stuck with.
The width of my submenu should be variable. So sometimes a few more pixels, depending on the submenu titles.
You can see it on: www.michaelscofield.nl
This is the (slightly modified) css code:
@charset "UTF-8";
/* CSS Document */
.menu {
font-family: "Trebuchet MS",Verdana,sans-serif;
width: 860px;
margin-top: 10px;
position: relative;
font-size: 12px;
z-index: 95;
height: 24px;
background-color: #403A2D;
}
.menu ul li a, .menu ul li a:visited {
text-decoration: none;
height: 20px;
line-height: 20px;
font-size: 12px;
overflow: hidden;
text-align: right;
margin: 0 2px 0 0;
padding: 2px 6px;
background: #403A2D url(/assets/templates/yoursite/images/menu_bullet.gif) no-repeat 6px center;
display: block;
font-weight:normal;
color: #fff;
}
.menu ul {
padding: 0;
margin: 0;
list-style-type: none;
}
.menu ul li {
float: left;
margin-right: 1px;
position: relative;
margin-left: 0;
}
.menu ul li ul {
display: none;
}
/* specific to non IE browsers */
.menu ul li:hover a {
color: #fff;
background-color: #403A2D;
}
.menu ul li.last a {
margin-right: 0;
}
.menu ul li:hover ul {
background-color: #403A2D;
display: block;
position: absolute;
top: 18px;
left: 0;
padding: 5px;
}
.menu ul li:hover ul li a.hide {
background: #fff;
color: #000;
}
.menu ul li:hover ul li:hover a.hide {
background: #deecf7;
color: #000;
}
.menu ul li:hover ul li ul {
display: none;
}
.menu ul li:hover ul li a {
display: block;
background: #403A2D;
color: #fff;
}
.menu ul li:hover ul li a:hover {
color: #fff;
font-weight:bold;
}
.menu ul li:hover ul li:hover ul {
display: block;
position: absolute;
left: 95px;
top: 0;
}
.menu ul li:hover ul li:hover ul.left {
left: -95px;
}
I try to understand these css parts, but It’s still kinda hard..
Thanks in advance!
edit: should be looking like this:
http://www.lechantduverdier.nl/