Christopher Lee
Christopher Lee

Reputation: 9

drop down menu push down white space?

I want to remove the drop down after I zoom in. When zoomed in Page got extra white space. How am I going to remove the drop down after i zoom in ? Here is my JsFiddle.

HTML

<body>
<div class="Top_Section">
<div class="Top_Warpper">
<div class="Pm_Logo"><a href="#"><h1>PM</h1></a></div>
<div class="Menu_Nav">
    <ul>
        <li><a href="#">About</a></li>
        <li><a href="#">Work</a></li>
        <li><a href="#">Publishing Solutions</a></li>
        <li><a href="#">Contact Us</a></li>
    </ul>
</div><!--end Menu_Nav-->
</div><!--end top warpper-->
</div><!--end top section-->

    <div class="redbg"></div>
</body>

<footer>
<div class="footer_warpper"></div><!--end of footer_warpper-->
</footer>

CSS

/*----Main menu css
----------------------------------------*/

.redbg{
    width:100%;
    height:700px;
    background-color:red;
}

.Top_Section{
position:fixed;
background:#000;
width:100%;
z-index:3000;
text-align:center;
}

.Top_Warpper{
max-width:970px;/*focus on the center view , so when zoom in it wont zoom to left*/
height:70px;
text-align:center;
margin:0px;
padding:0px;
background-color:#000;
margin-right:auto;
margin-left:auto;
}


.Pm_Logo{
position:relative;
top:0px;
float:left;
padding:0px;
margin:0px;
}

.Pm_Logo h1:hover {
color:#DAFF00;
}

.Pm_Logo h1{
    position:relative;
    margin:5px 5px;
    font-family:"Kunstware1.0 ALP", "helvetica neue", helvetica, arial, sans-serif;
    border: none; /*IE border fixed*/
    font-size:49.5px;
    display:inline-block;
    color:white;
}

.Menu_Nav{
padding:10px;
margin-bottom:10px;
}

.Menu_Nav ul{
margin:0px;
padding:0px;
}

.Menu_Nav ul li{
margin-top:17px;/*make the drop down meun stick to auto height , so it wont  over lap*/
display:inline;
list-style:none;
padding:10px 5px 10px 5px;
float:right; 
}

.Menu_Nav a{
font-style: italic; font-size: 1.1em;
list-style:none;
text-decoration: none;
padding:5px;
color:white;
font-weight:bold;
-webkit-transition: all .1s ease-out;
-moz-transition: all .1s ease-out;
-ms-transition: all .1s ease-out;
-o-transition: all .1s ease-out;
transition: all .1s ease-out;
background-color:red;
}

.Menu_Nav a:hover{
color:#DAFF00;
}


@media screen and (max-width: 480px) {

.Top_Section{
position:relative;
display:inline-block; 
margin:0px;
padding:0px;
}

.Menu_Nav ul{
font-size:10px;
display:inline-block;
}

}

Here is my JsFiddle. Please Zoom In and see the problem, thanks.

Upvotes: 0

Views: 411

Answers (1)

gespinha
gespinha

Reputation: 8497

Is this what you are looking for?

http://jsfiddle.net/gespinha/Tbc4v/3/

First issue

You are assigning div .Top_Wrapper a fixed height so it doesn't stretch, maintaining the black header background static when resizing the screen.

Second issue

You are also assigning the menu li elements a float: right; attribute, which takes these elements off the normal document flow and so require an element with a clear attribute to reassign these list items to the document flow.

This enables the header .Top_Wrapper div to follow its children's position and adjust its size according to the current element display.

.clear{
   clear:both;
}

(in this case the clear element should have a value of right but I used both just in case you need to reuse it on the rest of the project)

Upvotes: 1

Related Questions