PDA

View Full Version : menu



washawasha
01-02-2006, 03:01 PM
Hi everybody,
I have trying to make CSS TOP MENU,but i get all wrong,i start with it in <head><style type="text/css">

#csstopmenu, #csstopmenu ul{
padding: 0;
margin: 0;
list-style: none;
}

#csstopmenu li{
float: left;
position: relative;
}

#csstopmenu a{
text-decoration: none;
}

.mainitems{
border: 1px solid black;
border-left-width: 0;
background-color: #D8FE89;
}

.headerlinks a{
margin: auto 8px;
font-weight: bold;
color: black;
}

.submenus{
display: none;
width: 10em;
position: absolute;
top: 1.2em;
left: 0;
background-color: #EEFFCC;
border: 1px solid black;
}

.submenus li{
width: 100%;
}

.submenus li a{
display: block;
width: 100%;
text-indent: 3px;
}

html>body .submenus li a{ /* non IE browsers */
width: auto;
}

.submenus li a:hover{
background-color: yellow;
color: black;
}

#csstopmenu li>ul {/* non IE browsers */
top: auto;
left: auto;
}

#csstopmenu li:hover ul, li.over ul {
display: block;
}

html>body #clearmenu{ /* non IE browsers */
height: 3px;
}

</style>

<script type="text/javascript">

// CSS Top Menu- By JavaScriptKit.com (http://www.javascriptkit.com)
// Adopted from SuckerFish menu
// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
// Please keep this credit intact

startMenu = function() {
if (document.all&&document.getElementById) {
cssmenu = document.getElementById("csstopmenu");
for (i=0; i<cssmenu.childNodes.length; i++) {
node = cssmenu.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function(){
this.className=this.className.replace(" over", "")
}
}
}
}
}

if (window.attachEvent)
window.attachEvent("onload", startMenu)
else
window.onload=startMenu;

</script></head>
AND THIS IS A BODY<BODY>
<ul id="csstopmenu">

<li class="mainitems" style="border-left-width: 1px">
<div class="headerlinks"><a href="Bongo.html">Bongo Flavor</a></div>
<ul class="submenus">
<li><a href="gallery.html">gallery</a></li>
<li><a href="forum">Free JavaScripts</a></li>
<li><a href="index.html">Home</a></li>
<li><a href="mitungi.html">mitungi</a></li>
</ul>
</li>

<li class="mainitems">
<div class="headerlinks"><a href="mafia.html">mafia island</a></div>
<ul class="submenus" style="width: 14em">
<li><a href="history.html">History</a></li>
<li><a href="Uongozi.html">Uongozi</a></li>
<li><a href="picha.html">picha</a></li>
</ul>
</li>

<li class="mainitems">
<div class="headerlinks"><a href="friendship.html">friendship</a></div>
<ul class="submenus">
<li><a href="music.html">music</a></li>
<li><a href="hihop.html">Hip Hop</a></li>
<li><a href="taarab.html">taarab</a></li>
<li><a href="mnanda.html">mnanda</a></li>
</ul>
</li>

</ul>
O nly appear {bongo flabor}
{mafia islan} and {friendship}
its only appear "MAINITEMS"but"SUBMENUS"doesn't APPEAR.please help