简体   繁体   English

内容和页脚空间问题

[英]Content and footer space problems

I don't know why the space between the content-bottom and the footer is bigger than the space between header and content-top you can see an example here: [not found]. 我不知道为什么内容底部和页脚之间的空间大于标题和内容顶部之间的空间你可以在这里看到一个例子:[未找到]。 I want the same equal spacing for the content(that box) between header and footer...but always I get bigger spacing between content and footer..and I don't know how to fix it, please help me guys. 我希望页眉和页脚之间的内容(该框)具有相同的相等间距......但是我总是在内容和页脚之间获得更大的间距......我不知道如何解决它,请帮助我们。

Best Regards 最好的祝福

You have given your header, position:absolute and footer position:fixed. 你给了你的标题,位置:绝对和页脚位置:固定。 also height to middle container. 高度到中间容器。 This way your elements won't flow correctly. 这样,您的元素将无法正确流动。

My suggestion: 我的建议:

give header and footer position normal. 使页眉和页脚位置正常。 and give content: 并给出内容:

.wrap {margin:100px auto; .wrap {margin:100px auto; width:---px;} 宽度:---像素;}

如果您还要计算相关元素的填充和边距,请使用.height().outerHeight() .css('height') ,而不是使用.css('height')

You can download the Firebug plugin (http://getfirebug.com/) if you have Firefox. 如果您有Firefox,可以下载Firebug插件(http://getfirebug.com/)。 Using this plugin, you can view the CSS of individual elements on the page by hovering over them and pressing ctrl+shift+c. 使用此插件,您可以通过将鼠标悬停在页面上并按ctrl + shift + c来查看页面上各个元素的CSS。

You may also view paddings, margins, and heights via the "Layout" tab as well as edit CSS and see updates immediately as live, local changes. 您还可以通过“布局”选项卡查看填充,边距和高度,以及编辑CSS并立即查看更新作为实时的本地更改。 That allows for rapid CSS debugging. 这允许快速的CSS调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM