Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6987267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:54:53+00:00 2026-05-27T18:54:53+00:00

I am trying to do a menu in CSS with a Unordered List UL,

  • 0

I am trying to do a menu in CSS with a Unordered List UL, I have it almost working correctly.

I am having a little trouble, if you run the code below or look at it on the JSFiddle link here http://jsfiddle.net/hgBDV/1/ You will see there is a Horizontal menu, when you hove the 2nd to last item labeled “More” there is a Sub-menu.

That sub-menu is what I need help with, right now when you hover the “Menu” list item, the sub-menu becomes visible on the screen however you are unable to hover of the sub-menu.

Please help me correct this issue

<div id="nav-wrapper">
    <ul>

        <li><a href="">Link</a></li>
        <li><a href="">Link 2</a></li>        
        <li><a href="">Link 3</a></li>

        <li><a href="">Link 4</a></li>
        <li><a href="">Link 5</a></li>
        <li><a href="">More</a>
            <ul>
                <li><a href="">Sub Link 1</a></li>
                <li><a href="">Sub Link 2</a></li>
                <li><a href="">Sub Link 3</a></li>
                <li><a href="">Sub Link 4</a></li>
                <li><a href="">Sub Link 5</a></li>
            </ul>
        </li>
        <li><a href="">Link 7</a></li>

    </ul>
</div>

css

<style type="text/css">
#nav-wrapper ul {
    width: 700px;
    float: right;
    margin: 0;
    list-style-type: none;
}
#nav-wrapper ul li {
    vertical-align: middle;
    display: inline;
    margin: 0;
    color: black;
    list-style-type: none;
}
#nav-wrapper ul li a {
    text-decoration: none;
    white-space: nowrap;
    line-height: 45px;
    font-size: 13px;
    color: #666;
    padding: 5px 15px;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
}
#nav-wrapper ul li a:hover {
    color: #fff;
    background-color: #4caef2;
}
#nav-wrapper ul li a:visited {
    color: #666;
}

/* Hide Sub-menus */
#nav-wrapper ul ul,
#nav-wrapper ul li:hover ul ul,
#nav-wrapper ul ul li:hover ul ul{
    display: none;
}
/* SHOW Sub-menus on HOVER */
#nav-wrapper ul li:hover ul,
#nav-wrapper ul ul li:hover ul,
#nav-wrapper ul ul ul li:hover ul{
    display: block;
    margin:0;
    padding:0px 2px 2px 0px;
    border-color:#AAAAAA;
    border:1px;
    border-style:solid;
}
</style>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:54:53+00:00Added an answer on May 27, 2026 at 6:54 pm

    http://jsfiddle.net/hgBDV/2/

    You are having trouble because the line-height is 45px but your text-size is 13px. The sub-menu shows up when you hover over the ‘more’ link, but when you move your mouse outside of the bounds of the ‘more’ link, the sub-menu is no longer displayed. While you have set the margin to 0px, the line-height is allowing for a 20px gap. In my ‘fix’, i have set the line height to 0px. Google “css suckerfish” for an already invented wheel.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a CSS menu and am having a problem with the
So I'm trying my hands at a css menu and I have a simple
I have a html/css based menu and I'm trying to put a flash video
I have a standard ul-based CSS navigation menu. I'm trying to use Jquery to
I'm trying to create a unordered list, with each li element having it's own
I have a navigation menu with css. I'm trying to vertically and horizontally center
I am trying to build a menu using CSS.This is what i have done
I'm trying to create a css menu bar that has all grey text with
I am trying to create a css menu. I would like to remove border
I'm trying to build a multi-level dropdrown CSS menu for a website I'm doing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.