I work with a menu that I found at: http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm
I changed it to be centered using css editing in the 4th answer down: Unable to center ul inside div
The problem is that the dropdowns are not aligned, and I cannot figure out how to do this.
Here is the code:
HTML:
<!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=utf-8" />
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="ddsmoothmenu.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script type="text/javascript" src="ddsmoothmenu.js">
</script>
<script type="text/javascript">
ddsmoothmenu.init({
mainmenuid: "smoothmenu1",
orientation: 'h',
classname: 'ddsmoothmenu',
arrowswap: true,
contentsource: "markup"
})
</script>
<title>Untitled</title>
</head>
<body>
<div class="ddsmoothmenu" id="smoothmenu1">
<ul>
<li><a href="/index.html">Home</a></li>
<li><a href="/about.html">About Us</a>
<ul>
<li><a href="/history.html">History</a></li>
<li><a href="/pc.html">Precepts and Credo</a></li>
<li><a href="philan.html">Philanthropy</a></li>
</ul>
</li>
<li><a>Recruitment</a>
<ul>
<li><a>Rush Schedule</a></li>
<li><a href="/rpfaqs.html">Rush/Pledging FAQs</a></li>
</ul>
</li>
<li><a>Calendar</a></li>
<li><a href="/forum/index.php">Forum</a></li>
</ul>
<br style="clear: left" />
</div>
</body>
</html>
CSS
.ddsmoothmenu{
font: bold 12px Verdana;
background: #1c5a80;
width: 100%;
}
.ddsmoothmenu ul{
position: relative;
float: left;
left: 50%;
list-style: none;
padding: 0;
}
.ddsmoothmenu ul li{
position: relative;
display: inline;
float: left;
text-align:center;
right: 50%;
margin: 0 5px;
}
.ddsmoothmenu ul li a{
display: block;
background: #1c5a80;
padding: 8px 10px;
color: orange;
text-decoration: none;
}
* html .ddsmoothmenu ul li a{
display: inline-block;
}
.ddsmoothmenu ul li a:link, .ddsmoothmenu ul li a:visited{
color: orange;
}
.ddsmoothmenu ul li a.selected {
background: orange !important;
color: #1c5a80;
}
.ddsmoothmenu ul li a:hover{
background: orange;
color: #1c5a80;
}
.ddsmoothmenu ul li ul{
position: absolute;
left: -3000px;
display: none;
visibility: hidden;
}
.ddsmoothmenu ul li ul li{
display: inline;
float: none;
}
.ddsmoothmenu ul li ul li ul{
top: 0;
}
.ddsmoothmenu ul li ul li a{
font: normal 13px Verdana;
width: 160px;
padding: 5px;
margin: 0;
border-top-width: 0;
border-bottom: 1px solid gray;
}
* html .ddsmoothmenu{height: 1%;}
.downarrowclass{
position: absolute;
top: 12px;
right: 7px;
}
.rightarrowclass{
position: absolute;
top: 6px;
right: 5px;
}
.ddshadow{
position: absolute;
left: 0;
top: 0;
width: 0;
height: 0;
background-color: #ccc;
}
.toplevelshadow{
margin: 5px 0 0 5px;
opacity: 0.8;
}
.ddcss3support .ddshadow.toplevelshadow {
margin: 0;
}
.ddcss3support .ddshadow {
background-color: transparent;
box-shadow: 5px 5px 5px #aaa;
-moz-box-shadow: 5px 5px 5px #aaa;
-webkit-box-shadow: 5px 5px 5px #aaa;
}
Any help would be appreciated
The EDIT: . The actual problem is that the contents of the submenu appear outside the white (and shaded) container. It should be displayed inside the container.
source
share