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

WBOY
Release: 2016-06-24 12:08:03
Original
954 people have browsed it

我网页的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%;}
Copy after login

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

问题出在哪里呢


回复讨论(解决方案)

错在你没把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不是明摆着的事吗
你的源码贴全了,让大家看看

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!