Forums

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

Home Forums CSS Sub menus are going towards left instead of going vertically

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #250090
    wasim687
    Participant

    ul {
    list-style-type: none;
    margin: 0;
    padding:10px 2px 10px 2px;
    overflow: hidden;
    background-color:rgba(0,0,0,0.5);
    position: fixed; /* To keep navigation menu fixed*/
    top: 0px;
    left: 0px;
    width: 100%;
    height: 77px;
    z-index:1000;
    }

    li a {
    display:block;
    color: white;
    padding: 14px 16px;
    text-decoration: none;
    z-index: 1000;
    text-align:center;
    }

    li {
    float: left;
    }

    ul #submenu {
    display: none;
    }

    li a:hover {
    background-color: #111;

    }

    #250091
    Paulie_D
    Member

    You aren’t being specific enough in your selectors

    li {
    float: left;
    }
    

    This tells ALL list items to float left, wherever they are. You need to override that…perhaps with something like…

    ul #submenu > li {
    float:none;
    }
    
    #250113
    wasim687
    Participant

    Thanks,I really appreciate that. One more thing,what should I do now so that sub menus should come when I hover on unordered list?

    #250116
    Paulie_D
    Member

    More research.

    There are thousands of tutorials on building CSS dropdown menus….just google it.

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