No replies
sdrnr09
Offline
newbie
Last seen: 11 years 23 weeks ago
Joined: 2009-04-17
Posts: 1
Points: 0

Heres my issue. I have a CSS layout (a template) and attempted to add a drop down menu bar that i found in snippet.
I got the snippet integrated into the layout except that the position doesn't adjust relative to the browser size like the rest of the page. I'm guessing i need to somehow tell the nav bar to stay relative to the container it is in but i i can't seem to figure it out.

here is my HTML code for the section: i've simplified it as much as possible. I hope not too much

  • Company
  • Here is the CSS for the header from the template i'm using:

    /* Top|Header */
    .header {width:908px;text-align:left;}

    .header .topbar {background-color:#000;padding:8px 28px 17px 27px;font:normal 10px/14px Verdana, sans-serif;margin:0 0 7px 0;}
    .header .topbar .fastforward {padding:6px 0 2px 0;float:left;}
    .header .topbar .search {margin:3px 0 0 0;}
    .header .topbar .search .box {float:right;clear:right;margin:-18px 0 0 0;}
    .header .topbar .search .box input.txtfield {border-top:1px solid #fff;border-right:0px;border-bottom:1px solid #fff;border-left:1px solid #fff;background-color:#858585;color:#fff;padding:3px 4px 6px 4px;width:153px;font:normal 10px/14px Verdana, sans-serif;}
    * html .header .topbar .search .box input.txtfield {border-top:1px solid #fff;border-right:0px;border-bottom:1px solid #fff;border-left:1px solid #fff;background-color:#858585;color:#fff;padding:3px 4px 6px 4px;width:153px;height:23px;font:normal 10px/14px Verdana, sans-serif;}
    .header .topbar .search .box .btn {background:#e9c92e url(assets/btn_arrow.gif) 0 0 no-repeat;padding:2px 4px 5px 4px;width:23px;border:1px solid #fff;height:23px;}
    .header .topbar .search .links {text-align:right;margin:0 197px 0 0;padding:1px 0 0 0;}
    .header .topbar .search .links ul li {display:inline;}
    .header .topbar .search .links li.separator {padding:0 5px;color:#b9b9b9;}
    .header .topbar .search .links li a {color:#fff;font-weight:normal;}
    .header .topbar .search .links li a:hover {color:#88aad2;}

    .header .nav {text-align:left;background:#fff url(assets/nav/bar.gif) 28px 55px no-repeat;border-top:1px solid #dadbdb;border-right:1px solid #dadbdb;border-bottom:0px;border-left:1px solid #dadbdb;padding:0 28px 16px 27px;}
    .header .nav .logo {padding:16px 0 0 0;width:20%;}

    .header .nav .mainnav {float:right;white-space:nowrap;margin:29px 0 0 0;}
    .header .nav .mainnav ul {display:inline-block;}
    * html .header .nav .mainnav ul {display:inline;}
    .header .nav .mainnav li {padding:0 0 0 21px;display:inline;font:normal 13px/14px Arial, sans-serif;}
    .header .nav .mainnav li a {color:#000;font-weight:normal;}
    .header .nav .mainnav li a:hover {color:#88aad2;}

    .header .nav .mainnav .menu {position:absolute;left:-12px;top:-11px;margin:22px 0 0 19px;visibility:hidden;z-index:1;width:202px;text-align:left;height:123px;} /* see-through filter:alpha(opacity=93);-moz-opacity:0.93opacity:0.93; */
    .header .nav .mainnav .menu ul {display:block;background:#b8d58b url(assets/nav/gradient.gif) 0 0 repeat-x;position:absolute;top:15px;border-top:1px solid #b6b2b1;border-right:1px solid #b6b2b1;border-bottom:0px;border-left:1px solid #b6b2b1;}
    .header .nav .mainnav .menu li {border-bottom:1px solid #b5b1b1;display:block;font:normal 11px Arial, sans-serif;padding:0px;}
    .header .nav .mainnav .menu li a {color:#fff;display:block;padding:2px 50px 3px 9px;}
    .header .nav .mainnav .menu li a:hover {color:#000;padding:2px 50px 3px 9px;background:#f6e697 url(assets/nav/lo_gradient.gif) 0 0 repeat-x;}

    :curse:

    #toolbar {
    display: block;
    margin: 0;
    background-color: #FFFFFF;
    height: 30px;
    position: fixed;
    width: 392px;
    top: 92px;
    left: 538px;
    opacity: 0.95;
    list-style:none;
    z-index: 1;
    padding-top: 0;
    padding-right: 0px;
    padding-bottom: 0;
    right: 10px;
    }
    #toolbar li {
    float: right;
    margin:0;
    padding:0;
    }
    #toolbar li a {
    display:block;
    text-decoration:none;
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bold;
    padding-top: 8px;
    padding-right: 15px;
    padding-bottom: 7px;
    padding-left: 15px;
    }
    #toolbar li:hover ul {
    display: block;
    }
    #toolbar li:hover a {
    border-top: 2px solid white;
    padding-top: 6px;
    }
    #toolbar ul {
    display: none;
    float: none;
    position: absolute;
    margin: -5px 0 0 15px;
    padding: 0;
    list-style: none;
    z-index: 2;
    border-bottom: 2px solid black;
    background-color: white;
    opacity: 0.9;
    }
    #toolbar ul li {
    margin: 0;
    padding: 0;
    display: block;
    float: none;
    }
    #toolbar ul li a {
    width: 150px;
    margin: 0;
    padding: 8px 15px 8px 15px;
    display: block;
    float: none;
    font: bold 12px Arial, Helvetica, sans-serif;
    color: black;
    }
    #toolbar ul li a:hover {
    background-color: #DDD;
    }

    #toolbar {
    right: 10px;
    float: right;
    margin-top: 0px;
    margin-right: 25px;
    margin-bottom: 0px;
    margin-left: 0px;
    }