下拉菜单按下白色空间?

时间:2013-10-26 06:59:34

标签: html css

我希望在放大后删除下拉列表。当放大页面时获得额外的空白区域。我放大后如何删除下拉菜单? 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。请放大并查看问题,谢谢。

1 个答案:

答案 0 :(得分:1)

这是你在找什么?

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

第一期

您要将div .Top_Wrapper指定为固定的height,因此不会     伸展,保持黑色标题背景静止时     调整屏幕大小。

第二期

您还要将菜单li元素分配为float: right;     attribute,将这些元素从正常文档流中移除     因此需要具有clear属性的元素来重新分配这些元素     将项目列入文档流程。

这使得标题.Top_Wrapper div能够跟随其子节点并根据当前元素显示调整其大小。

.clear{
   clear:both;
}

(在这种情况下,clear元素的值应为right,但我使用了both,以防您需要在项目的其余部分重复使用它)

相关问题