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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:44:58+00:00 2026-06-16T05:44:58+00:00

Is there any way for me to use a div as a dropdown menu

  • 0

Is there any way for me to use a div as a dropdown menu positio exactly like this? I already tried absolute position but it doesn’t work with other screen size. What I want is for it to work on all screen resolutions. I tried using tables(hiding the td and showing it on hover)but the menu just pushes the contents below it. I desperately need to get this sorted out I’ve been working on it for weeks now and still not even close to what I want. Thank you in advance.

What I tried so far:
jQuery:

$(document).ready(function(){
   $("#hover-here").hover(function(){
     $("#boxed-menu-div").toggle();
  });
});

CSS:

#boxed-menu-div{
  display: none;
  position: absolute;
  top: 100px;
  right: 246px;
 }

This works perfectly only on my screen resolution. I used relative positioning but it only pushes the contents below. Is there any other alternatives to what absolute can do?

  • 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-16T05:45:00+00:00Added an answer on June 16, 2026 at 5:45 am

    Ok… First things first. Tables are a definite no and you don’t need jQuery either.

    You have four html elements that combined are designed to do this specific task.

    These are <nav>, <ul> <li> and <a>. Now I’m making an assumption here that since you want it to work on all screen sizes then you are wanting this to be responsive, I’m also assuming that since you want rounded corners, gradients, shadows etc then you will be aiming for modern browsers, ie9+ and the others.

    Bearing that in mind here would be the html I would use to create a menu.

    <nav>
        <ul>
            <li>
                <a href="#">item 1</a>
                <ul>
                    <li><a href="#">sub item 1</a><li>
                    <li><a href="#">sub item 1</a><li>
                    <li><a href="#">sub item 1</a><li>
                </ul>
            </li>
            <li>
                <a href="#">item 2</a>
                <ul>
                    <li><a href="#">sub item 1</a><li>
                    <li><a href="#">sub item 1</a><li>
                    <li><a href="#">sub item 1</a><li>
                </ul>
            </li>
            <li>
                <a href="#">item 3</a>
                <ul>
                    <li><a href="#">sub item 1</a><li>
                    <li><a href="#">sub item 1</a><li>
                    <li><a href="#">sub item 1</a><li>
                </ul>
            </li>
          </ul>
    </nav>
    

    The css would go something like this. Please note that I have only created a very rough approximation of what you are after.

    body{
        /* Set the overall font*/
        font-family:arial, serif;
    }
    
    /* Contain floats: h5bp.com/q */
    nav > ul:before, nav > ul:after {
        content: "";
        display: table;
    }
    
    nav > ul:after {
        clear: both;
    }
    
    nav > ul {
        *zoom: 1;
    }
    
    /* Level one */
    nav > ul > li {
        float:left;
        position:relative;
        overflow:visible;
        width:30%;
        max-width:100px;
    }
    nav > ul > li > a{
        padding:.5em 1em;
    }
    
    /* Level 2*/
    nav > ul > li > ul {
        background:#666;
        border-radius: 0 5px 5px 5px;
        position:absolute;
        z-index:1;
        padding:1em;
        width:200px; /*set to whatever you need*/
        display:none;
    }
    
    /* Second list on level 2*/
    nav > ul > li:nth-child(2) > ul{
        margin-left:-50%;
        border-radius: 5px;
    }
    
    /* Last list on level 2*/
    nav > ul > li:last-child > ul{
        right:0;
        border-radius: 5px 0 5px 5px;
    }
    
    /* Hover level 1*/
    nav > ul > li:hover {
        background:#666;
        border-radius: 5px 5px 0 0;
        color:#fff;
    }
    
    nav > ul > li:hover > ul {
        display:block;
    }
    
    nav > ul > li:hover > a,
    nav > ul > li > ul a{
        color:#fff;
    }
    
    nav a {
        text-decoration:none;
        display:block;
    }
    

    I’ve included a working example here for you to play with. As you can see this will work from mobile-up. Fullscreen link here resize to see it working.

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

Sidebar

Related Questions

Is there any way to position an image at the bottom of a div
Is there any way deferring PHP code? Like in javascript we use <script defer=defer></script>
Is there any way to use strip_tags in php smarty like in default ,
Is there any way to use Google's API to retrieve a user's current zipcode
Is there any way to use Zend_Filter_Encrypt with large files, without rising memory limit
Is there any way to use global int constants in Objective C that work
Is there any way to use server controls in ASP.NET MVC? Specifically I need
Is there any way to use ActiveRecord calculations while also acquiring relevant field names?
Is there any way to Use the Builtin ScrollBars that comes with each .Net
Is there any way to use conditional statements in CSS?

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.