文章來源地址http://www.zghlxwxcb.cn/news/detail-712426.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
html, body {
height: 100%;
margin: 0;
}
.container {
display: flex;
flex-direction: column;
height: 100%; /* 使用最小高度來確保占據(jù)整個屏幕 */
}
.top {
height: 100px;
background-color: lightgray;
}
.bottom {
flex-grow: 1;
background-color: lightblue;
}
</style>
<body>
<div class="container">
<div class="top">上</div>
<div class="bottom">下</div>
</div>
</body>
</html>
文章來源:http://www.zghlxwxcb.cn/news/detail-712426.html
到了這里,關于CSS:上面固定高度、下面填充滿,上面消失,下面仍然填充滿的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!