Alsacreations Website

Example



CSS Code

dl, dt, dd, ul, li {
margin: 0;
padding: 0;
list-style-type: none;
}
#menu {
position: absolute;
top: 1em;
left: 1em;
width: 10em;
}

#menu dt {
cursor: pointer;
background: #A9BFCB;
height: 20px;
line-height: 20px;
margin: 2px 0;
border: 1px solid gray;
text-align: center;
font-weight: bold;
}

#menu dd {
position: absolute;
z-index: 100;
left: 8em;
margin-top: -1.4em;
width: 10em;
background: #A9BFCB;
border: 1px solid gray;
}

#menu ul {
padding: 2px;
}
#menu li {
text-align: center;
font-size: 85%;
height: 18px;
line-height: 18px;
}
#menu li a, #menu dt a {
color: #000;
text-decoration: none;
display: block;
}

#menu li a:hover {
text-decoration: underline;
}

#mentions {
font-family: verdana, arial, sans-serif;
position: absolute;
bottom : 200px;
left : 10px;
color: #000;
background-color: #ddd;
}
#mentions a {text-decoration: none;
color: #222;
}
#mentions a:hover{text-decoration: underline;
}

HTML Code

<dl id="menu">
  <dt onmouseover="javascript:montre('smenu1');"><a href="#">Menu 1</a></dt>
  <dd id="smenu1" onmouseover="javascript:montre('smenu1');" onmouseout="javascript:montre();">
   <ul>
    <li><a href="#">Sub Menu 1.1</a></li>
    <li><a href="#">Sub Menu 1.2</a></li>
    <li><a href="#">Sub Menu 1.3</a></li>
   </ul>
  </dd>
  <dt onmouseover="javascript:montre('smenu2');" onmouseout="javascript:montre();">Menu2</dt>
  <dd id="smenu2" onmouseover="javascript:montre('smenu2');" onmouseout="javascript:montre();">
   <ul>
    <li><a href="#">Sub Menu 2.1</a></li>
    <li><a href="#">Sub Menu 2.2</a></li>
   </ul>
  </dd>
  <dt onmouseover="javascript:montre('smenu3');" onmouseout="javascript:montre();">Menu3</dt>
  <dd id="smenu3" onmouseover="javascript:montre('smenu3');" onmouseout="javascript:montre();">
   <ul>
    <li><a href="#">Sub Menu 3.1</a></li>
    <li><a href="#">Sub Menu 3.1</a></li>
    <li><a href="#">Sub Menu 3.1</a></li>
    <li><a href="#">Sub Menu 3.1</a></li>
    <li><a href="#">Sub Menu 3.1</a></li>
    <li><a href="#">Sub Menu 3.1</a></li>
   </ul>
  </dd>
  <dt onmouseover="javascript:montre('smenu4');" onmouseout="javascript:montre();">Menu4</dt>
  <dd id="smenu4" onmouseover="javascript:montre('smenu4');" onmouseout="javascript:montre();">
   <ul>
    <li><a href="#">Sub Menu 4.1</a></li>
    <li><a href="#">Sub Menu 4.1</a></li>
   </ul>
  </dd>
</dl>

Javascript

<script type="text/javascript">
<!--
window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
for (var i = 1; i<=10; i++) {
if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
}
if (d) {d.style.display='block';}
}
//-->
</script>