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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:23:02+00:00 2026-06-17T20:23:02+00:00

I ran into problems while styling drop-down menu. Everything is working fine but I

  • 0

I ran into problems while styling drop-down menu. Everything is working fine but I have absolute positioning in my CSS (which works) but it of course doesn’t work properly when I change my screen resolution. I am more programmer than a designer.

Here is my menu:

<div class="navigation">
<!-- some links -->
    <div id="menu">
        <a href="gallery.html">Galerie</a>
        <div id="submenu">
            <a href="galleryOldRooms.html" title="Starší pokoje">Starší pokoje</a><br />
            <a href="galleryNewRooms.html" title="Novější pokoje">Novější pokoje</a>
        </div>
    </div>
</div>

And here is the relevant CSS

#submenu {
   display: none;
   padding: 0px;
   margin-top: 5em;
   margin-left: 27.5em;
   position: absolute;
   left: 0px;
}
.nav a {
   border-right: 2px solid #161616;
   color: #CCC;
   float: left;
   font: bold 1em Verdana,sans-serif;
   line-height: 51px;
   padding: 0 20px;
}

And piece of jQuery which does the drop out

$(document).ready(function() {
    $("#menu").hover(function() {
        $("#submenu").fadeIn(); 
        }, 
    function() {
        $("#submenu").fadeOut();
    });
});

How can I improve this to be it more browser and resolution independent?

Edit

When I increase or decrease resolution of my display or try to look at it on bigger screen, the the drop-down menu is moved to either left or right side depending on the resolution. Which is obviously something I don’t. Here is the link, it’s not finished.

  • 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-17T20:23:03+00:00Added an answer on June 17, 2026 at 8:23 pm

    There are a number of issues here. I’ve modified the layout to be more inline with the way most developers set up this type of menu. I’ve also reversed most of your IDs and classes, which are being used in such a way as to almost guarantee duplicate IDs.

    This may not be an ideal answer to your question, but I think there’s some helpful information in it.

    http://jsfiddle.net/mrPse/8/

    #nav {
        position: relative;
    }
    #nav a {
        border-right: 2px solid #161616;
        color: #CCC;
        float: left;
        font: bold 1em Verdana, sans-serif;
        line-height: 51px;
        padding: 0 20px;
    }
    #nav > li {position: relative; display: inline-block;}
    #nav li ul li a {border-right: 0;}
    .submenu {
        display: none;
        padding: 0px;
        margin-top: 3em;
        position: absolute;
        left: auto;
        width: 180px;
    }
    .submenu li a {border-right: 0;}
    
    <ul id="nav">
        <li><a href="index.html">Úvod</a></li>
        <li><a href="prices.html">Ceník</a></li>
        <li class="menu">
            <a href="gallery.html">Galerie</a>
            <ul class="submenu" style="display: none;">
                <li><a title="Starší pokoje" href="galleryOldRooms.html">Starší pokoje</a></li>
                <li><a title="Novější pokoje" href="galleryNewRooms.html">Novější pokoje</a></li>
            </ul>
        </li>
        <li><a href="contact.html">Kontakt</a>
    
        </li>
    </ul>
    
    $(".menu").hover(function () {
        $(this).children(".submenu").fadeIn();
    }, function () {
        $(this).children(".submenu").fadeOut();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While creating an online shop application using play-1.2.4 ,I ran into some problems with
while working on a school project i ran into a problem using javascript to
while trying to deploy a Grails application into tomcat6 I ran into some problems:
I recently wanted to update my gem bundle but ran into installation problems with
I am working on a blackberry project and ran into some problems with the
While combining boost, a demo project and another library I ran into problems with
So I ran into a problem today while working on my Android program. I
while developing GWT apps we ran into lots of problems with project configuration. Let
(this is regarding the Ramaze.net framework) I ran into some really strange problems while
I've ran into a really weird problem while working on a large project. I

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.