好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

一个关于position:fixed;的问题_html/css_WEB-ITnose

我网页的header部分设置成了position: fixed;
正文部分的上端却被header遮住了
#header {    height: 87px;    left: 0;    overflow: visible;    position: fixed;    right: 0;    top: 0;    z-index: 10000;}#header, #footer {    margin: 0 auto;    width: 100%;} 

正文部分的css:
#wrapper {    background: none repeat scroll 0 0 #EDF0EB;    height: 500px;    margin: 0 auto;    padding-bottom: 20px;    padding-top: 20px;    position: relative;    width: 1024px;} 

问题出在哪里呢


回复讨论(解决方案)

错在你没把HTML贴出

#header 设置了 z-index: 10000;

#wrapper 设置一下 margin-top: 100px;

http://babybang测试数据/
这个网站没有设置margin-top: 100px; 也是z-index: 10000; 怎么他没有覆盖呢

错在你没把HTML贴出
+是啊。

#wrapper {
background: none repeat scroll 0 0 #EDF0EB;
height: 500px;
margin: 0 auto;
那你这个margin-top 为 0 了啊

#wrapper {
background: none repeat scroll 0 0 #EDF0EB;
height: 500px;
margin: 0 auto;
那你这个margin-top 为 0 了啊 http://babybang测试数据这个网站的正文 margin-top: 0;也没有遮盖呀

她的body上有
padding-top: 62px;

有人知道么

看来是对牛弹琴了,不是有margin-top就是有padding-top不是明摆着的事吗
你的源码贴全了,让大家看看

查看更多关于一个关于position:fixed;的问题_html/css_WEB-ITnose的详细内容...

  阅读:43次