WordPress.org

Support

Support » Themes and Templates » Quick CSS Queston regarding sub menu. Keeps dissapearing.

Quick CSS Queston regarding sub menu. Keeps dissapearing.

  • tenthoughts
    Member

    @tenthoughts

    Hi there,

    Hope this finds you well. I am updating a client’s site. The custom theme their former coder developed does not have the necessary code to support sub menus. I need to add the propper css to style.css so the sub menu does not live permanent under the menu.

    I would like be able to hover the word in the menu, then below the options appear, you click, the go to child page.

    Below is my css which is a little messy as I took it from various sites and put it together when testing. This makes the menu appear on hover but it dissapers when you take mouse away from the word in the menu. How do I keep the menu present until action is determined? Wht is the only code I need for this? Perhaps this code is conflicting with itself….

    Thank you so much for your help. Nick

    My css:
    —————————————

    .menu li {
    position: relative;
    }

    .menu .sub-menu {
    display: none;
    position: absolute;
    left:0;
    text-align: left;
    margin:0;
    width: 150px;
    }

    .menu .sub-menu .li {
    padding:0;
    }

    .menu li:hover > .sub-menu {
    display: block;
    position: absolute;
    top: 20px;
    padding-left: 0;
    background-color: #fff;
    width: 200px;
    }

    —————————————

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Quick CSS Queston regarding sub menu. Keeps dissapearing.’ is closed to new replies.