Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Navigation hover issue in IE

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #44962
    NicNacs
    Member

    I am having issues with a CSS navigation in IE. The navigation has top level links with drop down sub-menu’s on hover. The issue is that in IE when one moves off the top level link in an attempt to select one of the options from the drop down sub-menu, the sub menu disappears.

    The navigation displays fine in Firefox, Safari and Chrome but the issue occurs when using IE.

    I have used this exact navigation elsewhere (just without the extra padding between the main and sub links) and have tried a number of fixes but nothing seems to have worked. I am not sure if it has something to do with the header image which the navigation is placed on top of as when I remove this, the issue resolves in IE. BUT obviously I need both to work.

    Any help would be greatly appreciated.

    HTML code is:

    Main image

    CSS is:

    #header {
    width: 960px;
    height: 222px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    }

    .headertext {
    margin: -200px 0 0 650px;
    font-family: “Myriad Pro”, sans-serif;
    font-size: 0.9em;
    color: #ffffff;
    position: relative;
    z-index: 2;
    }

    .headertext ul{
    padding: 0px 0 0 30px;
    list-style-type: none;
    }

    .headertext li{
    padding: 0 10px 0 0;
    display: inline;
    font-family: “Myriad Pro”, Sans-serif;
    font-size: 0.8em;
    text-transform: uppercase;
    }

    .headertext li a{
    color: #ffffff;
    text-decoration: none;
    }

    .headertext li a:hover{
    color: #cccc99;
    }

    /* Main Image */

    #mainimage{
    width: 960px;
    height: 319px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 80px;
    }

    /* Nav Menu */

    #nav {
    width: 575px;
    margin: -350px 0 0 330px;
    position: absolute;
    z-index: 3;
    }

    ul#navmenu-h {
    height: 40px;
    list-style-type: none;
    padding: 0 0 0 0;
    margin: 0px;
    }

    ul#navmenu-h li {
    float: left;
    list-style: none;
    margin: 0;
    padding: 0 0 0 0;
    position: relative;
    }

    ul#navmenu-h ul {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute; top: 25px; left: 0px;
    }

    ul#navmenu-h ul:after /*From IE 7 lack of compliance*/{
    clear: both;
    font-size: 1.5em;
    height: 0;
    margin: 0;
    padding: 0;
    visibility: hidden;
    }

    ul#navmenu-h ul li {
    display: block !important;
    display: inline; /*For IE*/
    float: left; /*For IE 7 lack of compliance*/
    width: 150px;
    }

    /* Root Menu */
    ul#navmenu-h a {
    color:#ffffff;
    background-color:inherit;
    display: block;
    float: none !important; /*For Opera*/
    float: left; /*For IE*/
    font-family: Times New Roman;
    font-size: 0.9em;
    line-height: 30px;
    height: auto !important;
    height: 1%; /*For IE*/
    text-decoration: none;
    text-transform: uppercase;
    padding: 0px 20px 0 20px;
    border-left: 1px solid #FFF;
    }

    /* Root Menu Hover Persistence */
    ul#navmenu-h a:hover,
    ul#navmenu-h li:hover a,
    ul#navmenu-h li.iehover a {
    background: transparent;
    color: #cccc99;
    }

    ul#navmenu-h ul li a.first {
    border-top: 1px solid #FFF !important;
    }

    /* 2ND MENU
    ======================================================================*/
    ul#navmenu-h li ul {
    border: none;
    background: #333333;
    color: #fff;
    margin: 17px 0 0 0;
    width: 7.8em;
    }

    ul#navmenu-h li:hover li a,
    ul#navmenu-h li.iehover li a {
    background: #333333;
    width: 60px;
    border: none;
    color: #fff;
    float: none;
    font-weight: normal;
    font-size: 0.70em;
    text-transform: uppercase;
    }

    /* 2nd Menu Hover Persistence */
    ul#navmenu-h li:hover li a:hover,
    ul#navmenu-h li:hover li:hover a,
    ul#navmenu-h li.iehover li a:hover,
    ul#navmenu-h li.iehover li.iehover a {
    background: #333333;
    color: #cccc99;
    }

    /* Do Not Move
    ======================================================================*/
    ul#navmenu-h li:hover ul ul,
    ul#navmenu-h li:hover ul ul ul,
    ul#navmenu-h li.iehover ul ul,
    ul#navmenu-h li.iehover ul ul ul {
    display: block;
    }

    ul#navmenu-h li:hover ul,
    ul#navmenu-h ul li:hover ul,
    ul#navmenu-h ul ul li:hover ul,
    ul#navmenu-h li.iehover ul,
    ul#navmenu-h ul li.iehover ul,
    ul#navmenu-h ul ul li.iehover ul {
    display: block;
    }

    Thanks in advance!

    #135979
    NicNacs
    Member

    Thanks Melindrea :-)

    #140651
    ethayer594
    Member

    Nic, could you post how you solved this? I have the same issue and would like to fix it. Thanks!

    #142168
    NicNacs
    Member

    ethayer594, the problem was with the “top” positioning in the following CSS:

    #nav ul ul {
    background: #333333;
    border-radius: 0px;
    padding: 0;
    position: absolute;
    top: 105%;
    }

    This created a “disconnection” between the parent and subnav child. I removed it and added padding instead and it solved the issue on my side. I hope this is helpful to you.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.