Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Dec 2011
    Posts
    1
    Member #
    30219
    Hello guys. I have some problems with a drop down menu on my site. The whole thing reposition when I change the size of my web browser window. I will post my HTML+CSS and a picture to explain it better. I'm new at this stuff so don't go all "put the flux capacitor into the rocket engine" on me! My first forum post ever, sorry. Its very messy!

    HTML
    </div>
    <!-- end footer div-->
    <div id="wrapper">
    <div id="navMenu">

    <ul>
    <li><a href="#">Booking</a>
    <ul>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    </ul> <!-- end inner UL-->
    </li> <!-- end main LI -->
    </ul> <!-- end main UL -->
    <ul>
    <li><a href="#">Nyheter</a>
    <ul>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    </ul> <!-- end inner UL-->
    </li> <!-- end main LI -->
    </ul> <!-- end main UL -->
    <ul>
    <li><a href="#">Husregler</a>
    <ul>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    </ul> <!-- end inner UL-->
    </li> <!-- end main LI -->
    </ul> <!-- end main UL -->
    <ul>
    <li><a href="#">Drift</a>
    <ul>
    <li><a href="#">TV System</a></li>
    <li><a href="#">Internett</a></li>
    <li><a href="#">Renhold</a></li>
    <li><a href="#">Parkering</a></li>
    <li><a href="#">Link item</a></li>
    </ul> <!-- end inner UL-->
    </li> <!-- end main LI -->
    </ul> <!-- end main UL -->
    <ul>
    <li><a href="#">Kontakt</a>
    <ul>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    </ul> <!-- end inner UL-->
    </li> <!-- end main LI -->
    </ul> <!-- end main UL -->
    <ul>
    <li><a href="#">test</a>
    <ul>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>
    <li><a href="#">Link item</a></li>

    </ul> <!-- end inner UL-->
    </li> <!-- end main LI -->
    </ul> <!-- end main UL -->
    </div> <!-- end navMenu -->
    </div> <!-- end wrapper div -->


    </body>

    CSS:
    #navMenu {
    margin:0;
    padding:0;
    line-height:30px;
    }

    #navMenu ul {
    margin:0;
    padding:0;
    }

    #navMenu li {
    margin:0;
    padding:0;
    list-style:none;
    float:left;
    position:relative;
    background:#900;
    }

    #navMenu ul li a {
    text-align:center;
    font-family:"Arial Black", Gadget, sans-serif;
    text-decoration:none;
    height:30px;
    width:150px;
    display:block;
    color:#FFF;
    border:1px solid #FFF;
    text-shadow: 1px 1px 1px
    }

    #navMenu ul ul {
    position:absolute;
    visibility:hidden;
    top:32px;
    }

    #navMenu ul li:hover ul {
    visibility:visible;
    }

    /************************************************** ***********************/


    #navMenu li:hover {
    background:#C30;
    }

    #navMenu ul li:hover ul li a:hover {
    background:#F63;
    color:#000;
    }

    #navMenu a:hover {
    color:#000;
    }
    dropdown correct.pngdropdown.png

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    You have a wrapper div called out in your HTML but not in your CSS.

    Define it with a fixed width, suggest 3-5 px wider than the total of your menu buttons.

    Set it with a margin 0, padding 0.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:45 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com