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 686861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:04:03+00:00 2026-05-14T02:04:03+00:00

Can anyone help with a small problem. I’ve got a nice simple CSS dropdown

  • 0

Can anyone help with a small problem.

I’ve got a nice simple CSS dropdown menu

http://www.cinderellahair.co.uk/new/CSSDropdown.html

The problem I have is when you rollover a menu item that has children which are wider than the content, it pushes the whole menu right.

Aside of shortening the child menu links down, is there any tweak I can make to my CSS to stop this happening?

CSS Code:

    /* General */
#cssdropdown, #cssdropdown ul { list-style: none; }
#cssdropdown, #cssdropdown * { padding: 0; margin: 0; }
#cssdropdown {padding:43px 0px 0px 0px;}

/* Head links */
#cssdropdown li.headlink { margin:0px 40px 0px -1px; float: left; background-color: #e9e9e9;}
#cssdropdown li.headlink a { display: block; padding: 0px 0px 0px 5px; text-decoration:none; }
#cssdropdown li.headlink a:hover { text-decoration:underline; }

/* Child lists and links */
#cssdropdown li.headlink ul { display: none; text-align: left; padding:10px 0px 0px 0px; font-size:12px; float:left;}
#cssdropdown li.headlink:hover ul { display: block; }
#cssdropdown li.headlink ul li a { padding: 5px; height: 17px; }
#cssdropdown li.headlink ul li a:hover { background-color: #333; }

/* Pretty styling */
body { font-family:Georgia, "Times New Roman", Times, serif; font-size: 16px; }
#cssdropdown a { color: grey; } #cssdropdown ul li a:hover { text-decoration: none; }
#cssdropdown li.headlink { background-color: white; }
#cssdropdown li.headlink ul { padding-bottom: 10px;}

HTML:

    <ul id="cssdropdown">
    <li class="headlink"><a href="http://www.cinderellahair.co.uk/new/index.php">HOME</a></li>
    <li class="headlink"><a href="http://www.cinderellahair.co.uk/new/gallery/gallery.php">GALLERY</a>
        <ul>
            <li><a href="http://amazon.com/">CELEBRITY</a></li>
            <li><a href="http://ebay.com/">BEFORE &amp; AFTER</a></li>
            <li><a href="http://craigslist.com/">HAIR TYPES</a></li>
        </ul>
    </li>
    <li class="headlink"><a href="http://www.cinderellahair.co.uk/new/about-cinderella-hair-extensions/about-us.php">ABOUT US</a>
        <ul>
            <li><a href="http://amazon.com/">WHY CHOOSE CINDERELLA</a></li>
            <li><a href="http://ebay.com/">TESTIMONIALS</a></li>
            <li><a href="http://craigslist.com/">MINI VIDEO CLIPS</a></li>
            <li><a href="http://craigslist.com/">OUR HAIR PRODUCTS</a></li>
        </ul>
    </li>
    <li class="headlink"><a href="http://www.cinderellahair.co.uk/new/news-and-offers/news.php">NEWS &amp; OFFERS</a>
        <ul>
            <li><a href="http://amazon.com/">VERA WANG FREE GIVEAWAY</a></li>
            <li><a href="http://ebay.com/">CINDERELLA ON TV</a></li>
            <li><a href="http://craigslist.com/">CINDERELLA IN THE PRESS</a></li>
            <li><a href="http://craigslist.com/">CINDRELLA NEWSLETTERS</a></li>
        </ul>
    </li>
    <li class="headlink"><a href="http://www.cinderellahair.co.uk/new/cinderella-salon/salon-finder.php">SALON FINDER</a></li>


</ul>

JS Code:

    $(document).ready(function(){
    $('#cssdropdown li.headlink').hover(
        function() { $('ul', this).css('display', 'block'); },
        function() { $('ul', this).css('display', 'none'); });
});

Full code is on the link above, just view source.

  • 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-14T02:04:03+00:00Added an answer on May 14, 2026 at 2:04 am

    DEMO: http://jsbin.com/owuqe/edit

    You need to set the position of UL menu like this

    the container UL

      <ul id="cssdropdown" style="position:relative">
    

    all the inner UL

      <ul style="position:absolute">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 492k
  • Answers 492k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Your comparison function is wrong - it returns bool, not… May 16, 2026 at 10:23 am
  • Editorial Team
    Editorial Team added an answer Return Values A MYSQL* connection handle if the connection was… May 16, 2026 at 10:23 am
  • Editorial Team
    Editorial Team added an answer I'm not sure what you're trying to do, but you… May 16, 2026 at 10:23 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

can anyone help? I have small procedure to read in an UTF-8 file with
can anyone help?, i am stuck with a linq query.. basically i have a
Can anyone help me? I can't figure out what I am doing wrong but
I have a small problem on IE browser (actually on Google Chrome too) I
I've a WPF app organized with tabs. I added a small button to each
For a personal project of mine, I'm writing up a small class to compress
I'm still somewhat new to WPF (only done a few small projects with it).
I'm building a small web application with ASP.NET MVC 2, using db4o as a
thanks in advance for your help. I'm using this piece of code to replace
I have read that HttpURLConnection supports persistent connections, so that a connection can be

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.