gpt4 book ai didi

html - 如何使页脚贴在底部并将正文内容从页眉拉伸(stretch)到页脚

转载 作者:太空宇宙 更新时间:2023-11-04 13:00:36 25 4
gpt4 key购买 nike

我有以下 ASP.net 代码:

<div class="pageContent">
<div style="width: 85%; text-align: center; margin: 0 auto;">
<div class="headerContent brClear">
ZSasdasdassad
</div>
<div class="bodyContent brClear">
<asp:ContentPlaceHolder ID="BodyPlaceHolder" runat="server">
</asp:ContentPlaceHolder>
</div>
<div class="footerContent brClear">
asdasdads
</div>
</div>
</div>

CSS:

.pageContent
{
width: 100%;
height: 100%;
text-align: center;
margin: 0 auto;
position: relative;
}
.brClear
{
clear: both;
}
.headerContent
{
width: 100%;
height: 165px;
background: #ffd800;
}
.bodyContent
{
width: 100%;
height: 550px;
background: #f00
}
.footerContent
{
width: 100%;
height: 120px;
background: #ffd800;
position: fixed;
bottom: 0;
}

100% 显示:

enter image description here

以 70% 显示:

enter image description here

如何修改 CSS 以便:

  1. 红色正文内容从顶部黄色标题的末尾延伸一直到页面底部,底部填充大小为页脚,以便没有任何内容被阻止?
  2. 底部黄色页脚紧贴底部但不拉伸(stretch)到整个页面,但保持在父级 DIV 宽度的 85% 以内?

最佳答案

.pageContent 中设置 width: auto;height: auto, 并去掉 position: fixed; 在页脚中:http://jsfiddle.net/vdcmgune/

关于html - 如何使页脚贴在底部并将正文内容从页眉拉伸(stretch)到页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25491691/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com