gpt4 book ai didi

css - 如何在不考虑页脚的情况下设置 HTML 页面的高度?

转载 作者:行者123 更新时间:2023-11-28 12:57:53 26 4
gpt4 key购买 nike

我想在下载文件时像 Google Chrome 那样省略页面高度的页脚。我的页面如下所示:

enter image description here

我想避免像这样滚动:

enter image description here

这是我的页脚代码:

 <footer class="tr-emulate">
<div class="float-left" style="margin-left: 5px; padding-top: 8px;">
<button class="k-button" onclick="javascript:document.getElementById('logoutForm').submit();">Cerrar sesión: @User.Identity.Name</button>
</div>
<div class="float-right" style="margin-right: 5px; padding-top: 12px;">&copy; @DateTime.Now.Year - DirecTV &nbsp;</div>
</footer>

这是标签的 CSS 样式:

footer {
clear: both;
background-color: #e2e2e2;
font-size: .8em;
text-align: left;
width: 100%;
bottom: 0;
position: fixed;
height: 37px;
}

我该怎么做?

最佳答案

这会让您走上正确的道路:

FIDDLE

HTML:

<div id="wrap">
<div id="content"></div>
</div>
<footer></footer>

CSS:

body, html{
width:100%;
height:100%;
margin:0;
padding:0;
}
#wrap{
height:90%;
width:100%;
overflow:auto;
}
#content{
height:300%;
width:100%;
background:green;
}

footer{
width:100%;
height:10%;
position:fixed;
bottom:0;
left:0;
background:red;
}

关于css - 如何在不考虑页脚的情况下设置 HTML 页面的高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22015288/

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