【发布时间】:2014-03-14 13:52:19
【问题描述】:
我正在使用修改后的 960 网格构建响应式网站:
@media only screen and
(min-width: 720px) and (max-width: 959px){
.container_12{
margin-left: auto;
margin-right: auto;
width: 720px;
}
}
还有一个使用 position:fixed 将自身锁定在页面顶部的导航栏。
.nav-band{
width: 100%;
font-weight: bold;
position: fixed;
z-index: 3;
overflow: hidden;
background-image:url('../img/trans_black.png');
padding: 2px;
}
这在大多数情况下都可以正常工作,但在我的 Android 平板电脑上会中断。页面加载并正常工作,但是当我旋转平板电脑(将所有带有 .container_12 的标签从宽度:720px 更改为宽度:480px)时,导航栏要么消失,要么被锁定在页面一半的奇怪位置。我怎样才能解决这个问题?该网站还有一个图像,显示在 .header-band 内的导航栏后面:
.header-band{
background-image:url('../img/header_band3.png');
background-repeat:repeat-x;
background-position:top;
height: 400px;
background-color: #050505;
position: fixed;
z-index: 1;
}
<div class='pageband nav-band'>
<ul class='horizontal-list'>
<li class='nav-item active'>
<a href="http://...">Home</a>
</li>
...
</ul>
</div>
<div class='pageband header-band'> </div>
<div class='pageband core-band'>
<div class='pageband logo-band '>
<div class='container_12'>
...
【问题讨论】:
标签: html css navigation css-position