标签:abs 直接 width 自动 pre 测试用例 type pos 100%
body为绝对定位,最小显示高度为:100%,宽度为:100%;底部显示块为绝对定位,bottom: 0,是body元素的最后一个直接子元素;底部块元素同级元素的上一个兄弟元素的边距可以包含下底部元素即可;<!DOCTYPE html>
<html lang="en">
<head>
<style>
.slibing-div{
border: 2px red solid;
height: 200px;
}
.footer{
border: 2px blue solid;
}
</style>
</head>
<body style="min-height: 100%; width: 100%; position: absolute;">
<div style="margin-bottom: 100px;" class="slibing-div">
<div style="text-align: center">测试用例</div>
</div>
<div style="position: absolute; bottom: 0; width: 100%; height: 100px;" class="footer">
底部块
</div>
</body>
</html>标签:abs 直接 width 自动 pre 测试用例 type pos 100%
原文地址:https://www.cnblogs.com/li1234yun/p/9190685.html