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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:45:49+00:00 2026-05-14T15:45:49+00:00

This is probably (hopefully) a pretty simple question, but I can’t seem to get

  • 0

This is probably (hopefully) a pretty simple question, but I can’t seem to get it to work so I’ll turn to the experts here. I’m using a pretty straightforward CSS drop-down menu, with just a little JQuery involved. The issue is that when I hover over the drop-down and it opens, it’s pushing everything on the page down below it rather then opening over it. I’ve tried messing with the z-index but that doesn’t seem to be the issue. Any tips would be fantastic, thanks in advance.

Here’s the HTML; sorry it’s not super-pretty, I had to rip out a bunch of stuff to make it simple and generic.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<HTML style="zoom: 100%; "> 
<HEAD> 
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js" type="text/javascript"></script> 
</HEAD> 
<BODY class="bodyclass" style="background:#BCE2F1; height: 100%;"> 

<DIV id="maincontainer" style="min-height: 100%;"> 
  <STYLE type="text/css"> 
    #cssdropdown, #cssdropdown ul { font-size: 9pt; background-color: black; list-style: none; }
    #cssdropdown, #cssdropdown * { padding: 0; margin: 0; }
    #cssdropdown li.headlink { width: 140px; float: left; margin-left: -1px; border: 1px black solid;
          background-color: white; text-align: center; }
    #cssdropdown li.headlink a { display: block; color: #339804; padding: 3px; text-decoration: none; }
      #cssdropdown li.headlink a:hover { background-color: #F8E0AC; font-weight: bold; }
    #cssdropdown li.headlink ul { display: none; border-top: 1px black solid; text-align: left; }
    #cssdropdown li.headlink:hover ul { display: block; text-decoration: none; }
    #cssdropdown li.headlink ul li a { padding: 5px; height: 15px; }
    #cssdropdown li.headlink ul li a:hover { background-color: #CCE9F5; text-decoration: none; font-weight: normal; }
    /* #cssdropdown a { color: #CCE9F5; } */
      #cssdropdown ul li a:hover { text-decoration: none; }
    #cssdropdown li.headlink { background-color: white; }
    #cssdropdown li.headlink ul { background-color: white; background-position: bottom; padding-bottom: 2px; }
  </STYLE> 
  <SCRIPT language="JavaScript"> 
    $(document).ready(function(){
        $('#cssdropdown li.headlink').hover(
            function() { $('ul', this).css('display', 'block'); },
            function() { $('ul', this).css('display', 'none'); });
    });
  </SCRIPT> 

  <DIV class="navigation_box" style="border: none;"> 
    <DIV class="innercontent"> 
      <DIV style="background: white; float: left; padding: 5px; border: solid 1px black;"> 
      LOGO
      </DIV> 
      <DIV class="navmenu" style="float: right; bottom: 0; font-size: 9pt; text-align: right;"> 
        <SPAN>Logged in as user@example.com</SPAN><BR> 
        <UL id="cssdropdown"> 
            <LI class="headlink"> 
                <A href="http://localhost:3000/one">One</A> 

                <UL style="display: none; "> 
                    <LI><A href="http://localhost:3000/one">Option One</A></LI> 
                    <LI><A href="http://localhost:3000/one">Option Two</A></LI> 
                    <LI><A href="http://localhost:3000/one">Option Three</A></LI> 
                    <LI><A href="http://localhost:3000/one">Option Four</A></LI> 
                </UL> 
            </LI> 
            <LI class="headlink"> 
                <A href="http://localhost:3000/two">Two</A> 

                <UL style="display: none; "> 
                    <LI><A href="http://localhost:3000/two">Option Two-One</A></LI> 
                    <LI><A href="http://localhost:3000/two">Option Two-Two</A></LI> 
                    <LI><A href="http://localhost:3000/two">Option Two-Three</A></LI> 
                </UL> 
            </LI> 
            <LI class="headlink" style="width: 80px;"> 
              <A href="http://localhost:3000/three">Three</A> 
            </LI> 
            <LI class="headlink" style="width: 300px; padding-top: 2px; height: 19px;"> 
              <FORM action="http://localhost:3000/search" method="post"> 
                  <P> 
                    Search:
                    <INPUT id="searchwords" name="searchwords" size="20" type="text" value=""> 
                    <INPUT name="commit" type="submit" value="Find"> 
                  </P> 
              </FORM> 
            </LI> 
          <LI class="headlink" style="width: 60px;"> 
            <A href="http://localhost:3000/four">Four</A> 
          </LI> 
          <LI class="headlink" style="width: 60px;"> 
                        <A href="http://localhost:3000/logout">Logout</A> 
      </LI> 
        </UL> 
      </DIV> 
    </DIV> 
  </DIV> 
  <DIV id="contentwrapper" style="clear:both"> 
    <DIV class="innercontent" style="margin: 0px 20px 20px 20px;"> 
      <H1>Some test content here to fill things out a little bit.</H1> 
    </DIV> 
  </DIV> 
</DIV> 
<DIV id="footer" style="clear: both; float: bottom;"> 
  <DIV class="innercontent" style="font-size: 10px;"> 
    Copyright 2008-2010
  </DIV> 
</DIV> 
</BODY> 
  • 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-14T15:45:49+00:00Added an answer on May 14, 2026 at 3:45 pm

    This is a pretty bad case of unnecessary Javascript to do what can be done via CSS itself. One way or another all you have to do is change:

    #cssdropdown li.headlink ul { display: none; border-top: 1px black solid; text-align: left;}
    

    to:

    #cssdropdown li.headlink ul { display: none; border-top: 1px black solid; text-align: left;position:absolute;}
    

    Here’s an example of an extremely simple and clean drop down menu. Hope it helps you out a bit. I added a lot of comments to help you figure out what the CSS is doing to the HTML.

        <style type="text/css">
    
        /* Get ride of default margin's and padding */
        ul, li {
            margin: 0;
            padding: 0;
        }
    
        /* Display parent unordered list items horizontally */
        ul li {
            float: left;
            list-style: none;       /* Get rid of default Browser styling */
            margin-right: 10px;     /* Add some space between items */
        }
    
            /* Hide inset unordered Lists */
            ul li ul {
                display: none;
            }
    
            /* Un-Hide inset unordered Lists when parent <li> is hovered over */
            ul li:hover ul {
                display: block;
                position: absolute;
            }
    
                /* Clear the any element that may be "float: left;" (Essentially moves the item to the next line */
                ul li:hover ul li {
                    clear: left;            
                }
    
        </style>
        <ul>
            <li>
                <a href="#" title="">Link 1</a>
                <ul>
                    <li><a href="#" title="">Link 1.1</a></li>
                    <li><a href="#" title="">Link 1.2</a></li>
                    <li><a href="#" title="">Link 1.3</a></li>
                    <li><a href="#" title="">Link 1.4</a></li>
                    <li><a href="#" title="">Link 1.5</a></li>
                    <li><a href="#" title="">Link 1.6</a></li>
                </ul>
            </li>
            <li>
                <a href="#" title="">Link 2</a>
                <ul>
                    <li><a href="#" title="">Link 2.1</a></li>
                    <li><a href="#" title="">Link 2.2</a></li>
                    <li><a href="#" title="">Link 2.3</a></li>
                    <li><a href="#" title="">Link 2.4</a></li>
                    <li><a href="#" title="">Link 2.5</a></li>
                    <li><a href="#" title="">Link 2.6</a></li>
                </ul>
            </li>
            <li>
                <a href="#" title="">Link 3</a>
                <ul>
                    <li><a href="#" title="">Link 3.1</a></li>
                    <li><a href="#" title="">Link 3.2</a></li>
                    <li><a href="#" title="">Link 3.3</a></li>
                    <li><a href="#" title="">Link 3.4</a></li>
                    <li><a href="#" title="">Link 3.5</a></li>
                    <li><a href="#" title="">Link 3.6</a></li>
            </ul>
        </li>
    </ul>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.