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

  • SEARCH
  • Home
  • 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 8296339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:57:27+00:00 2026-06-08T14:57:27+00:00

i have problem on dropdown menu.Dropdown menu expand to right when open.i check margin,padding

  • 0

i have problem on dropdown menu.Dropdown menu expand to right when open.i check margin,padding and white value but i do not found solution.There is live sample on here

Demo

HTML:

<div id="header">  
   <div class="nav">
        <ul>
            <li><span class="home"></span><a href="#index.html">Lorem ipsum</a></li>
            <li><span class="department"></span><a href="#department.html" class="drop_down">Lorem ipsum</a>
                <ul id="submenu">
                    <li><a href="#">Lorem ipsum</a></li>
                    <li><a href="#">Lorem ipsum</a></li>
                    <li><a href="#">Lorem ipsum</a></li>
                </ul>
            </li>
            <li><span class="index"></span><a href="#">Lorem ipsum</a></li>
        </ul>
    </div>
</div>

CSS:

#header .nav{background:green; height:42px;font-family:Arial;}
#header .nav ul{margin:0;padding:0;list-style:none;}
#header .nav ul li{float:left;padding:10px 20px 0 20px;border-right:solid 1px #ccc;height:32px;}
#header .nav ul li a{color:#fff;text-decoration:none;font-size:0.8em;}
#header .nav ul li span{height:17px;margin:3px 10px 0 0;float:left;}
#header .nav ul li span.home{background:url('../image/home.png') no-repeat left top;width:18px;}
#header .nav ul li span.department{background:url('../image/department.png') no-repeat left top;width:18px;}
#header .nav ul li span.index{background:url('../image/index.png') no-repeat left top;width:17px;}
#header .nav ul li span.recipe{background:url('../image/recipe.png') no-repeat left top;width:14px;}
#header .nav ul li span.car{background:url('../image/car.png') no-repeat left top;width:17px;}
#header .nav ul li a.drop_down{background:url('../image/arrow_down.png') no-repeat 50px 4px;width:17px;padding-right:14px;}
#header .nav ul li ul#submenu{position:absolute;display:none;margin:13px 0 0 -20px;border-top:solid 1px #ccc;}
#header .nav ul li ul#submenu li{clear:both;background:blue; height:42px;font-family:Arial;border-bottom:solid 1px #ccc;margin:0;padding:5px;width:100%;display:inline-block;}​

JS:

    $(function(){
        $(".drop_down").hover(
            function(){
                $("ul#submenu").stop(true,true).slideDown("slow",function(e){
                    $(this).hover(
                        function(){
                            $(this).show();
                        },
                        function(){
                            $(this).slideDown();
                        }
                    );
                });
            },
            function(){
                $("ul#submenu").stop(true,true).slideUp("slow");
            }
        );
    });​

​

  • 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-06-08T14:57:30+00:00Added an answer on June 8, 2026 at 2:57 pm

    width: 100%; in #header .nav ul li ul#submenu li is causing this, give some fix width like 100px; and this will solve your expanding width bug.

    My Fiddle

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

Sidebar

Related Questions

I have a dropdown menu on my page but there are some problem i.e
I have a problem with the positioning of a pure css dropdown menu. You
I have problem SIMILAR to preventing form data reposting, but not quite the same
I have problem getting the dropdown menu to work using Twitter's Bootstrap. Here's my
I have a problem in a jquery dropdown menu. In my example (link in
I have built a dropdown menu system, everything works when tested independently, the problem
I have a problem with getting dropdown menu to appear in Magento when using
Hi I have a problem with jQuery banner and dropdown menu. The dropdown menu
Once again I have an IE problem. I have a dropdown menu with <LI>
I have a little problem here with my dropdown menu. When I hover a

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.