I was getting help with a menubar in a different forum, but the person who was helping me was unable to sort out a few problems. This is mostly css.
This is the menubar: http://www.celticawen.frih.net/test/home.php I can't get the "home" link the right size or color. The size was ok until I added the borders in the dropdown part. here's all my coding:
CSS
HTML
Javascript in head tags
I also wanted to add a 3rd level to some links, if anyone can help with that it would be great.
This is the menubar: http://www.celticawen.frih.net/test/home.php I can't get the "home" link the right size or color. The size was ok until I added the borders in the dropdown part. here's all my coding:
CSS
| Code: |
| body {
margin: 0; padding: 0; font: 80% verdana, arial, sans-serif; } dl, dt, dd, ul, li { margin: 0; padding: 0; list-style-type: none; } #menu { position: absolute; /* Menu position that can be changed at will */ top: 0; left: 0; z-index:100; width: 100%; /* precision for Opera */ } #menu dl { float: left; width: 10em; } #menu dt { cursor: pointer; text-align: center; font-weight: bold; color: #FFFFCC; background: #663300; border-width: 2px; border: outset; border-style: solid; border-color: #E4D8AF; margin: 0; } #menu dd { display: none; border: 1px; border-style: solid; border-color: #CFB58D; } #menu li { text-align: center; background: #E4D8AF; color: #663300 } #menu li a, #menu dt a { color: #663300; background: #E4D8AF; text-decoration: none; display: block; height: 100%; border-width: 1px; border: outset; border-style: solid; border-color: #CFB58D; margin: 0; } #menu li a:hover, #menu li a:focus, #menu dt a:hover, #menu dt a:focus { color:#CFB58D; background: #FFFFCC; } #site { position: absolute; z-index: 1; top : 70px; left : 10px; color: #000; background-color: #663300; padding: 5px; border: 1px #CFB58D; } |
HTML
| Code: |
| <div id="menu">
<dl> <dt onmouseover="javascript:show();"><a href="" title="Return to home">Home</a></dt> </dl> <dl> <dt onmouseover="javascript:show('smenu1');">Mythology</dt> <dd id="smenu1" onmouseover="javascript:show('smenu1');" onmouseout="javascript:show('');"> <ul> <li><a href="index.html">sub-menu 1.1</a></li> <li><a href="#">sub-menu 1.2</a></li> <li><a href="#">sub-menu 1.3</a></li> <li><a href="#">sub-menu 1.4</a></li> <li><a href="#">sub-menu 1.5</a></li> <li><a href="#">sub-menu 1.6</a></li> </ul> </dd> </dl> <dl> <dt onmouseover="javascript:show('smenu2');">Menu 2</dt> <dd id="smenu2" onmouseover="javascript:show('smenu2');" onmouseout="javascript:show('');"> <ul> <li><a href="#">sub-menu 2.1</a></li> <li><a href="#">sub-menu 2.2</a></li> <li><a href="#">sub-menu 2.3</a></li> <li><a href="#">sub-menu 2.4</a></li> </ul> </dd> </dl> <dl> <dt onmouseover="javascript:show('smenu3');">Menu 3</dt> <dd id="smenu3" onmouseover="javascript:show('smenu3');" onmouseout="javascript:show('');"> <ul> <li><a href="#">sub-menu 3.1</a></li> <li><a href="#">sub-menu 3.2</a></li> <li><a href="#">sub-menu 3.3</a></li> <li><a href="#">sub-menu 3.4</a></li> <li><a href="#">sub-menu 3.5</a></li> </ul> </dd> </dl> <dl> <dt onmouseover="javascript:show('smenu4');">Menu 4</dt> <dd id="smenu4" onmouseover="javascript:show('smenu4');" onmouseout="javascript:show('');"> <ul> <li><a href="#">sub-menu 4.1</a></li> <li><a href="#">sub-menu 4.2</a></li> <li><a href="#">sub-menu 4.3</a></li> </ul> </dd> </dl> </div> |
Javascript in head tags
| Code: |
| <script type="text/javascript">
<!-- window.onload=show; function show(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> |
I also wanted to add a 3rd level to some links, if anyone can help with that it would be great.
