您好,欢迎来到分汇财经。
搜索
您的当前位置:首页一个关于position:fixed;的问题_html/css_WEB-ITnose

一个关于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.com/
这个网站没有设置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.com这个网站的正文 margin-top: 0;也没有遮盖呀

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

有人知道么

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

Copyright © 2019- fhgjylc.com 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务