Html 身高不会增长
我有一个网页,分为页眉,页面和页脚 问题是我让页面Html 身高不会增长,html,css,height,Html,Css,Height,我有一个网页,分为页眉,页面和页脚 问题是我让页面height:auto。 但它不工作,我需要的网页自动成长 这就是我在CSS中的内容: /* Page */ #page-wrapper { overflow: auto; height: auto; text-align: center; } #page { overflow: auto; width: 1120px; margin: 0px auto; padding: 50px 4
height:auto代码>。
但它不工作,我需要的网页自动成长
这就是我在CSS中的内容:
/* Page */
#page-wrapper {
overflow: auto;
height: auto;
text-align: center;
}
#page {
overflow: auto;
width: 1120px;
margin: 0px auto;
padding: 50px 40px;
color: #8F8F8F;
min-height:700px;
height:auto;
}
和HTML:
<body>
<div id="banner">
<div class="img-border">
<div id="header-wrapper">
<div id="header">
<div id="logo">
</div>
</div>
</div>
</div>
</div>
<div id="wrapper">
<div id="page-wrapper">
<div id="page">
<div id="wide-content">
</div>
</div>
</div>
</div>
你根本不需要那里的高度。。。一个div将随着其内部内容的数量而增长或收缩。尝试删除高度:自动;完全是
如果您的意思是,即使没有足够的内容,也要使内容部分达到页面高度的100%,这应该会有所帮助您的意思是希望页面底部的页脚和中间的div占据剩余的空间(从您的措辞中很难确定)
如果这就是你想要的,我建议你看看这篇博文:
HTML摘要:
<div id="container">
<div id="header"></div>
<div id="body"></div>
<div id="footer"></div>
</div>
现在还不清楚你想要什么
在第一行中,你说你想要一个页脚,但是你的HTML和CSS没有显示任何页脚
如果你想要一个粘在页面底部的页脚,请查看。ohh好的,我会编辑我的问题。请发布所有相关代码,最好是a我不明白问题是什么,预期的行为是什么。html,body{height:100%;}你有浮动元素吗?刚刚更新了答案。。。我猜你想让它填满屏幕是自动高度的原因?同样,div应该始终延伸到其内容的高度。因此,我们可能需要的不仅仅是“它不起作用”,我的意思是它传递div页面,页面内容进入页脚。这不是我的情况,先生,我有一个评论框,因此当评论有10行或更多行时,它的内容进入页脚部分
html,
body {
margin:0;
padding:0;
height:100%;
}
#container {
min-height:100%;
position:relative;
}
#header {
background:#ff0;
padding:10px;
}
#body {
padding:10px;
padding-bottom:60px; /* Height of the footer */
}
#footer {
position:absolute;
bottom:0;
width:100%;
height:60px; /* Height of the footer */
background:#6cf;
}