esthera
06-13-2006, 06:38 PM
below is my html and css code. this is for a css dropdown menu.
My problem is I want the whole menu to be a witdh of 775 and I can't seem to get it that width. (it's not going wide enough)
Please advise what I have to do to set it that width. I tried to set the width of each li but if I go any larger then it is then it just pushes one of th li to the next line.
thanks
<html>
<link href="s.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
startList = function() {
if (document.all && document.getElementById) {
navRoot = document.getElementById("dmenu");
for (i=0; i < navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;
//-->
</script>
<body>
<ul class="topmenu" id="dmenu">
<li class="topmenuli"><a href="default.asp" class="topmenutitle">Home</a>
</li>
<li class="topmenuli"><a href="aboutus.asp" class="topmenutitle">About Us</a>
</li>
<li class="topmenuli"><a href="" class="topmenutitle">Our Services</a>
<ul class="submenuul">
<li class="submenuli"><a href="services.asp">Services</a></li>
<li class="submenuli"><a href="funds.asp">Fundraising /a></li>
</ul>
</li>
<li class="topmenuli"><a href="fund.asp" class="topmenutitle">Fundraising Tools</a>
</li>
<li class="topmenuli"><a href="contact.asp" class="topmenutitle">Contact Us</a>
</li>
<li class="topmenuli"><a href="sitemap.asp" class="topmenutitle">SiteMap</a>
</li>
</ul>
<br><br>
<div class="content">
everthi els here
</div>
</body>
</html>
/* minimum menu requirements for functionality */
.topmenuul{
list-style-type:none;
margin:0;
padding:0;
}
.topmenuli{
list-style-type:none;
float:left;
}
.topmenutitle{
display:block;
width:122px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #FFFFFF;
background-color: #000000;
}
.topmenutitle2{
display:block;
width:130px;
}
.submenuul{
list-style-type:none;
position:absolute;
margin: 0;
padding:0;
display:none;
}
.submenuli a{
display:block;
width:250px;
}
li:hover ul , li.over ul{ /* lists nested under hovered list items */
display: block;
}
#dmenu li>ul {
top: auto;
left:auto;
}
#content {
clear: left;
}
/* menu design */
#dmenu {
font-family: Arial, Helvetica, Sans-Serif;
font-size:12px;
padding-left:0px;
}
.topmenuul {
}
.topmenutitle {
/*text-indent:3px;*/
text-decoration: none;
border:1px solid #000000;
/*padding:3px;*/
line-height:14px;
}
.submenuul {
margin-top:-1px;
background-color:#E7F7FF;
background-position: top left;
background-repeat: repeat-x;
border-top:1px solid #000000;
border-bottom:2px solid #000000;
border-right:2px solid #000000;
border-left:7px solid #FF0000;
}
.submenuli a{
padding:3px;
text-decoration: none;
color: #000000;
}
.submenuli a:hover{
text-decoration: none;
background:#336699;
color: #FFFFFF;
}
My problem is I want the whole menu to be a witdh of 775 and I can't seem to get it that width. (it's not going wide enough)
Please advise what I have to do to set it that width. I tried to set the width of each li but if I go any larger then it is then it just pushes one of th li to the next line.
thanks
<html>
<link href="s.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
startList = function() {
if (document.all && document.getElementById) {
navRoot = document.getElementById("dmenu");
for (i=0; i < navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;
//-->
</script>
<body>
<ul class="topmenu" id="dmenu">
<li class="topmenuli"><a href="default.asp" class="topmenutitle">Home</a>
</li>
<li class="topmenuli"><a href="aboutus.asp" class="topmenutitle">About Us</a>
</li>
<li class="topmenuli"><a href="" class="topmenutitle">Our Services</a>
<ul class="submenuul">
<li class="submenuli"><a href="services.asp">Services</a></li>
<li class="submenuli"><a href="funds.asp">Fundraising /a></li>
</ul>
</li>
<li class="topmenuli"><a href="fund.asp" class="topmenutitle">Fundraising Tools</a>
</li>
<li class="topmenuli"><a href="contact.asp" class="topmenutitle">Contact Us</a>
</li>
<li class="topmenuli"><a href="sitemap.asp" class="topmenutitle">SiteMap</a>
</li>
</ul>
<br><br>
<div class="content">
everthi els here
</div>
</body>
</html>
/* minimum menu requirements for functionality */
.topmenuul{
list-style-type:none;
margin:0;
padding:0;
}
.topmenuli{
list-style-type:none;
float:left;
}
.topmenutitle{
display:block;
width:122px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #FFFFFF;
background-color: #000000;
}
.topmenutitle2{
display:block;
width:130px;
}
.submenuul{
list-style-type:none;
position:absolute;
margin: 0;
padding:0;
display:none;
}
.submenuli a{
display:block;
width:250px;
}
li:hover ul , li.over ul{ /* lists nested under hovered list items */
display: block;
}
#dmenu li>ul {
top: auto;
left:auto;
}
#content {
clear: left;
}
/* menu design */
#dmenu {
font-family: Arial, Helvetica, Sans-Serif;
font-size:12px;
padding-left:0px;
}
.topmenuul {
}
.topmenutitle {
/*text-indent:3px;*/
text-decoration: none;
border:1px solid #000000;
/*padding:3px;*/
line-height:14px;
}
.submenuul {
margin-top:-1px;
background-color:#E7F7FF;
background-position: top left;
background-repeat: repeat-x;
border-top:1px solid #000000;
border-bottom:2px solid #000000;
border-right:2px solid #000000;
border-left:7px solid #FF0000;
}
.submenuli a{
padding:3px;
text-decoration: none;
color: #000000;
}
.submenuli a:hover{
text-decoration: none;
background:#336699;
color: #FFFFFF;
}