www.webdeveloper.com
Results 1 to 2 of 2

Thread: CSS Horizontal Menu drop-downs behind content in IE8 and earlier

  1. #1
    Join Date
    Aug 2011
    Posts
    1

    CSS Horizontal Menu drop-downs behind content in IE8 and earlier

    My website uses a horizontal CSS (only) menu with CSS content and the site works fine in Firefox 5+, IE9, and Chrome, but in IE8 and earlier the drop-down options are behind the content boxes. I have tried z-index solutions found here and elsewhere without success. It's possibly my inexperience with CSS, but I really need to get this working. Any help would be appreciated.

    The link to the website is:
    http://www.whitewaterbasketball.com

    Here is the CSS:

    body #css_menu {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9px;
    }

    #css_menu {
    /* width of menu */
    width: 98%;
    /* center menu tabs or not */
    text-align:center;
    /* put your positioning statements here */
    margin: 0px 0px 10px 0px; padding: 0 0 0 0;
    z-index: 500;
    }

    /*-----HEIGHT OF ITEMS */
    /* all menu items */
    #css_menu { height: 25px; }
    #css_menu a
    {
    line-height:25px;
    text-decoration: none;
    }
    /* all hover items */
    #css_menu a:hover ul,
    #css_menu li.left a:hover ul,
    #css_menu ul li:hover > ul,
    #css_menu li.left:hover > ul { top:25px; z-index: 500;}
    /* flyout positioning - this number must remain negative */
    #css_menu ul ul li:hover > ul,
    #css_menu li.left ul li:hover > ul { margin-top:-25px;}
    /*-----*/

    /* ITEM ARROWS AND FONT STYLING WHEN ITEM HAS DROPDOWNS AND FLYOUTS */
    /* menu arrow down */
    #css_menu li a.down {
    background:transparent url(arrow-down-white.gif) no-repeat right center;
    }
    /* menu arrow right, font color and weight when item has flyouts */
    #css_menu li ul a.flyout {
    background:#868686 url(arrow-right-black.gif) no-repeat right center;
    color: #FFFFFF;
    /* bold or not */
    font-weight: bold;
    /* uppercase or not */
    text-transform: capitalize;
    }
    /* menu arrow left, font color and weight when item has flyouts */
    #css_menu li.left ul a.flyout {
    background:#868686 url(arrow-left-black.gif) no-repeat left center;
    color: #FFFFFF;
    /* bold or not */
    font-weight: bold;
    /* uppercase or not */
    text-transform: capitalize;
    }

    /* ITEM BACKGROUND, BORDER AND FONT STYLING */
    /* level one: main menu and default font styling */
    #css_menu {
    /* remove background to get floating tabs */
    /* font family if desired */
    /*font-family: Verdana,Arial,sans-serif;*/
    /* cursor style */
    cursor: pointer;
    /* border if desired
    border: 1px solid #FFFFFF;
    border-width: 0px 1px -20px 1px; */
    z-index: 500;
    }

    /* level one; main menu tabs */
    #css_menu ul.level1 { background:transparent; }
    #css_menu ul.level1 a {
    background: #000000;
    color: #FFFFFF;
    font-size: 1.2em;
    /* bold or not */
    font-weight: bold;
    /* uppercase or not */
    text-transform: uppercase;
    /* letter spacing */
    /*letter-spacing: 2px;*/
    /* item padding */
    padding:0 10px 0 10px;
    margin:8px 5px 12px 5px;
    /* border if desired */
    border: 1px solid #FFFFFF;
    border-width: 1px 1px 1px 1px;
    z-index: 500;
    }
    /* level two dropdown */
    #css_menu ul.level2 { background:transparent; }
    #css_menu ul.level2 a {
    background: #868686;
    color: #FFFFFF;
    font-size: 1.2em;
    /* bold or not */
    font-weight: bold;
    /* uppercase or not */
    text-transform: none;
    /* letter spacing */
    /*letter-spacing: 2px;*/
    /* item padding */
    margin: 15px 0px -15px 5px;
    padding:0 20px 0 10px;
    z-index: 500;
    /* border if desired */
    /*border: 1px solid #000000;
    border-width: 1px 1px 1px 1px;*/
    }
    /* level three flyout */
    #css_menu ul.level3 { background:transparent; }
    #css_menu ul.level3 a {
    background: #868686;
    color: #FFFFFF;
    font-size: 1.2em;
    /* bold or not */
    font-weight: bold;
    /* uppercase or not */
    text-transform: none;
    /* letter spacing */
    /*letter-spacing: 2px;*/
    /* item padding */
    padding:0 20px 0 10px;
    margin:15px 0 -15px -15px;
    z-index: 500;
    /* border if desired */
    /*border: 1px solid #000000;
    border-width: 1px 1px 1px 1px;*/
    }
    /* level four flyout */
    #css_menu ul.level4 { background:transparent; }
    #css_menu ul.level4 a {
    background: #868686;
    color: #FFFFFF;
    font-size: 1.2em;
    /* bold or not */
    font-weight: bold;
    /* uppercase or not */
    text-transform: none;
    /* letter spacing */
    /*letter-spacing: 2px;*/
    /* item padding */
    padding:0 20px 0 10px;
    z-index: 500;
    /* border if desired */
    /*border: 1px solid #000000;
    border-width: 1px 1px 1px 1px;*/
    }
    /* hover - these two should be the same */
    #css_menu li a:hover,
    #css_menu li a.flyout:hover {
    background-color:#9C0000;
    color: #FFFFFF;
    /* bold or not */
    font-weight: bold;
    /* underline or not */
    text-decoration:none;
    }
    #css_menu li:hover > a,
    #css_menu ul li:hover > a.flyout {
    background-color:#9C0000;
    color: #FFFFFF;
    /* bold or not */
    font-weight: bold;
    /* underline or not */
    text-decoration:none;
    }




    /* INDIVIDUAL LEVEL 1 TAB BACKGROUNDS */
    #css_menu #tab1 { background: #088040; }
    #css_menu #tab2 { background: #6666FF; }
    #css_menu #tab3 { background: #804000; }
    #css_menu #tab4 { background: #004080; }
    #css_menu #tab5 { background: #808000; }
    #css_menu #tab6 { background: #7F7F7F; }
    #css_menu #tab7 { background: #008080; }
    #css_menu #tab8 { background: #A36BFE; }
    #css_menu #tab9 { background: #800040; }
    #css_menu #tab10 { background: pink; }

    /*===== DO NOT CHANGE ANYTHING BELOW THIS LINE =====*/
    #css_menu { z-index: 500; }
    #css_menu a { display:block; }
    #css_menu a:hover ul {left:0; }
    #css_menu li.left a:hover ul {left:auto; right:-1px; }
    #css_menu ul {margin:0; padding:0; list-style:none; white-space:nowrap; text-align:left;}
    #css_menu ul {display:inline-block;}
    #css_menu li {margin:0; padding:0; list-style:none;}
    #css_menu li {display:inline-block; display:inline;}
    #css_menu ul ul {position:absolute; left:-9999px;}
    #css_menu ul.level1 {margin:0 auto;}
    #css_menu ul.level1 li.level1-li {float:left; display:block; position:relative;}
    #css_menu b {position:absolute;}
    #css_menu ul.level1 li.level1-li a.level1-a {float:left;}
    #css_menu ul li:hover > ul {visibility:visible; left:0; }
    #css_menu ul ul li:hover > ul {visibility:visible; left:100%; top:auto;}
    #css_menu li.left:hover > ul {visibility:visible; left:auto; right:0; }
    #css_menu li.left ul li:hover > ul {visibility:visible; left:auto; right:100%; top:auto; }
    #css_menu li.left ul a {text-align:right; padding:0 10px 0 20px;}
    #css_menu a:hover a:hover ul,
    #css_menu a:hover a:hover a:hover ul {left:100%; visibility:visible;}
    #css_menu li.left a:hover a:hover ul,
    #css_menu li.left a:hover a:hover a:hover ul {left:auto; right:0; visibility:visible;}
    #css_menu a:hover ul ul, #css_menu a:hover a:hover ul ul {left:-9999px;}
    #css_menu li.left a:hover ul ul, #css_menu li.left a:hover a:hover ul ul {left:-9999px;}
    #css_menu table {position:absolute; height:0; width:0; left:0; border-collapse:collapse; margin-top:-4px;}
    #css_menu table table {position:absolute; left:99%; height:0; width:0; border-collapse:collapse; margin-top:-29px;}
    #css_menu li.left table {position:absolute; height:0; width:0; left:auto; right:0; border-collapse:collapse; margin-top:-4px;}
    #css_menu li.left table table {position:absolute; left:auto; right:100%; height:0; width:0; border-collapse:collapse; margin-top:-29px;}

  2. #2
    Join Date
    Feb 2008
    Location
    Europe
    Posts
    266
    You have more problems in IE7: http://prntscr.com/2qjvk. And your code is riddled with errors - see http://validator.w3.org/. Plus your css is riddled with comments, making it very awkward to work with.

    The best advice I can give you is to do a (better) course in html + css, e.g. at http://htmldog.com, which is for free. Then, create your site under IE7, not under IE8.

    Or have your site remade by a professional web designer, if you're in a hurry.
    Last edited by Frank62; 08-22-2011 at 09:25 AM.
    R.,
    Frank

    Please report back how suggestions worked out.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles