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
    Amsterdam, The Netherlands
    Posts
    273
    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.
    .
    How to: Target IE in, Position in, Center in, Create a Fixed ('Sticky') Footer with, and Create a Drop-Down/Fly-Out Menu with CSS: Website Laten Maken Amsterdam.

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

"

"

X vBulletin 4.2.2 Debug Information

  • Page Generation 0.13836 seconds
  • Memory Usage 2,862KB
  • Queries Executed 15 (?)
More Information
Template Usage (32):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (2)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates