简体   繁体   English

div设置为100%无法正常工作

[英]div set to 100% wont work

here is my site http://iadprint.com/about 这是我的网站http://iadprint.com/about

i am trying to make the menu tag and the colright div to have a height of 100% and stick to the footer div pushing down to the bottom. 我试图使菜单标签和colright div具有100%的高度,并坚持将页脚div向下推到底部。 but no matter what i try nothing works. 但无论我尝试什么都行不通。 i have tried validating the html but only 3 errors exist which arent that important to fix. 我曾尝试验证html,但仅存在3个错误,因此无法修复。 what ami doing wrong? 我究竟做错了什么?

您需要使用人造背景技术CSS (可能与table-cell )或JavaScript

I'm a fan of fixed layouts for this sort of scenario where you want a footer to always appear at the bottom of the window: 我喜欢这种情况的固定布局,在这种情况下,您希望页脚始终显示在窗口底部:

header
{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 130px;
}

nav
{
    width: 960px;
    margin: 0 auto;
}

article
{
    top: 130px;
    bottom: 120px;
    left: 0;
    width: 100%;
    position: fixed;
    overflow: auto;
}

footer
{
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
}

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

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