|
|
Thread Tools | Display Modes |
|
#1
|
|
|
Beginner grinner
|
Need Navbar Help Please!
I just started working on a Navbar on my brand new smugmug site (http://noahburrell.smugmug.com), but the trouble is that I simply can't get the Navbar to center on the page. If you go to my site, you'll also note that the navbar does not work since the dropdown functions get in the way with the page descriptions and other such things....do you see what I mean? I would really appreciate some help on the code and tips on how to fix this. You'll note that there is a lot of superfluous junk in my CSS code since it was adopted from that fantastic post of how to do the dropdown navbar. Here's my CSS code:
/* CSS Section */ /* style the outer div to give it width */ .menu { margin:0 auto; padding:10px 0px 15px 0px; position:relative; /*Make the container moveable*/ width:750px; /*Main bar total width*/ font-size:0.85em; padding-bottom:30px; /*Padding between the bottom of your mainbar and the rest of your page */ } /* remove all the bullets, borders and padding from the default list styling */ .menu ul { padding:0; margin:0; list-style-type:none; } .menu ul ul { width:125px; /* Cell size. Divide the main width (750px) by the number of cells you need */ } /* float the list to make it horizontal and a relative positon so that you can control the dropdown menu positon */ .menu li { float:left; width:125px; /* Cell size. Divide the main width (750px) by the number of cells you need */ position:relative; } /* style the links for the top level */ .menu a, .menu a:visited { display:block; font-size:13px; text-decoration:none; color:#fff; width:100; /* Defines the main box dimensions. */ height:30px; /*How tall your cells are*/ border:1px solid #fff; border-width:1px 1px 0 0; background:#758279; padding-left:50px; line-height:29px; /*Adjust this to vertically center your text in each cell. Should be about the same as height. */ } /* a hack so that IE5.5 faulty box model is corrected */ * html .menu a, * html .menu a:visited { width:125px; w\idth:139px; } /* style the second level background */ .menu ul ul a.drop, .menu ul ul a.drop:visited { background:#949e7c; } /* style the second level hover */ .menu ul ul a.drop:hover{ background:#c9ba65; } .menu ul ul :hover > a.drop { background:#c9ba65; } /* style the third level background */ .menu ul ul ul a, .menu ul ul ul a:visited { background:#e2dfa8; } /* style the third level hover */ .menu ul ul ul a:hover { background:#b2ab9b; } .menu ul ul ul :hover > a { background:#b2ab9b; } /* hide the sub levels and give them a positon absolute so that they take up no room */ .menu ul ul { visibility:hidden; position:absolute; height:0; top:31px; left:0; width:125px; /* Size of the daughter cells */ } /* another hack for IE5.5 */ * html .menu ul ul { top:30px; t\op:31px; /* IE gap between main bar and the dropdown items */ } /* position the third level flyout menu */ .menu ul ul ul{ left:125px; top:0; width:125px; } /* position the third level flyout menu for a left flyout */ .menu ul ul ul.left { left:-125px; } /* style the table so that it takes no ppart in the layout - required for IE to work */ .menu table {position:absolute; top:0; left:0;} /* style the second level links */ .menu ul ul a, .menu ul ul a:visited { background:#d4d8bd; color:#000; height:auto; line-height:1em; padding:5px 10px; width:129px /* yet another hack for IE5.5 */ } * html .menu ul ul a{ width:125px; w\idth:129px; } /* style the top level hover */ .menu a:hover, .menu ul ul a:hover{ color:#fff; background:#949e7c; } .menu :hover > a, .menu ul ul :hover > a { color:#fff; background:#949e7c; } /* make the second level visible when hover on first level list OR link */ .menu ul :hover ul{ visibility:visible; } /* keep the third level hidden when you hover on first level list OR link */ .menu ul :hover ul ul{ visibility:hidden; } /* keep the fourth level hidden when you hover on second level list OR link */ .menu ul :hover ul :hover ul ul{ visibility:hidden; } /* make the third level visible when you hover over second level list OR link */ .menu ul :hover ul :hover ul{ visibility:visible; } /* make the fourth level visible when you hover over third level list OR link */ .menu ul :hover ul :hover ul :hover ul { visibility:visible; } /* End Navbar Code */ /* Navigation Bar */ And my html (header) code: <div align="left"> <div class="menu"> <ul> <!-- First Main Menu Item --> <li><a href="http://noahburrell.smugmug.com/" title="Homepage">Home<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> </li> <!-- Next Main Menu Item --> <li><a class="drop" href="http://noahburrell.smugmug.com/Nature" title="Galleries">Galleries<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href="http://noahburrell.smugmug.com/Natur.../9550456_mJT2m" title="Local Birds">Humboldt County Birds</a></li> <li><a href="http://noahburrell.smugmug.com/Natur.../9683388_Vf3wx" title="Alaskan Birds">Arctic Birds</a></li> <li><a href="http://noahburrell.smugmug.com/Natur.../9686339_grWWG" title="Misc. Wildlife Photos">Wildlife Photos</a></li> <li><a href="http://noahburrell.smugmug.com/Natur.../9654319_iTnip" title="Insects, flowers, salamanders, etc...">Small Things</a></li> <!--[if lte IE 6]><table><tr><td><![endif]--> </ul> </li> <!-- Next Main Menu Item --> <li><a class="drop" href="http://noahburrell.smugmug.com/gallery/9646060_epWbY" title="Prints, Products, and Ordering Info">Ordering<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href="http://noahburrell.smugmug.com/Other.../9679831_5nczw" title="How to Purchase Prints">Purchasing Prints</a></li> <li><a href="http://noahburrell.smugmug.com/Other.../9686454_o9Eds" title="Pricing and Product Options">Prices and Products</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> <!-- Next Main Menu Item --> <li><a href="http://noahburrell.smugmug.com/gallery/9645772_Uucbj" title="The Photographer">About Me<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> <!-- Next Main Menu Item --> <li><a href="http://noahburrell.smugmug.com/gallery/9644874_uCthQ" title="Please sign the guestbook!">Guestbook<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> </ul> </div> </div> Thanks so much! |
|
|
|
| Tell The World! | |
| Thread Tools | |
| Display Modes | |
|
|