<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>CSS Menu</title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
</head>
<body>
</body>
</html>
<ul class="mainmenu">
<li>
<dt>Websites</dt>
<ul>
<li><dt>Divetime</dt></li>
<li><dt>DropZone</dt></li>
<li><dt>Rockclimbing</dt></li>
</ul>
</li>
<li>
<dt>Electronics</dt>
</li>
<li>
<dt>Home</dt>
</li>
</ul>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<style>
.mainmenu {
}
</style>
</head>
.mainmenu li {
border: 1px solid black;
}
.mainmenu {
list-style-type:none;
margin:0px;
}
.mainmenu li {
border:1px solid black;
width:150px;
height:25px
}
.mainmenu li ul {
list-style-type:none;
margin:0px;
}
.mainmenu li {
border:1px solid #AEB6F4;
background:#D2D6F9;
width:150px;
height:25px;
}
.mainmenu li ul {
list-style-type:none;
margin:0px;
position:relative;
top: -15px;
left: 50px;
}
.mainmenu li:hover {
background:#88A2FB;
}
.mainmenu li ul {
list-style-type:none;
margin:0px;
position:relative;
top: -15px;
left: 75px;
display:none;
}
.mainmenu li:hover ul {
display:block;
}
<li><a target="_blank" href="http://www.divetime.com/"><dt>Divetime</dt></a></li>
.mainmenu a {
display:block;
width:125px;
height:25px;
text-decoration:none;
}
.mainmenu dt {
margin-top:3px;
padding-left:7px;
}
.mainmenu li ul {
list-style-type:none;
margin:0px;
position:relative;
top: -15px;
left: 75px;
display:none;
}
.mainmenu li:hover ul {
display:block;
}
.mainmenu li ul,
.mainmenu li:hover li ul {
//styles in here
}
.mainmenu li:hover ul,
.mainmenu li:hover li:hover ul {
//styles in here
}
.mainmenu li ul,
.mainmenu li:hover li ul,
.mainmenu li:hover li:hover li ul {
//styles in here
}
.mainmenu li:hover ul,
.mainmenu li:hover li:hover ul,
.mainmenu li:hover li:hover li:hover ul {
//styles in here
}
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (5)
Author
Commented:Thanks for letting me know. I am assuming other users can't see the article. Would it be ok for me to update it a bit later in the week? I'm a little caught up in work at the moment.
Author
Commented:I am really hung up on work right now, So it will be a while before I can shift my attention to this article. I'll try my best to get it ready though....
Thanks
Commented:
Does the dt tag have a role in the menu besides just the spacing? Does it have to be that tag? Without the dl tag the dt tag will most likely cause validation issues. If you are using it for a tag so you can provide the style then I suggest the span tag instead.
Thanks for the article and work to provide it.
bol
Author
Commented:I did start of with the <span> at first, but then I changed it to the <dt> tag for some reason. I can't remember why... I need to document my reasons better.
But as you said, it would be better to use the <span> tag. I already tested it, and it seems that the menu still functions as expected.
Regards,
EZFrag
Commented:
IE6 out of the box is not compatible but http://www.xs4all.nl/~peterned/csshover.html will solve this problem for you.