如果我有以下 HTML 代码:
<!DOCTYPE html>
<html>
<head>
<title>test</title>
<style>
.container {
display: flex;
flex-direction: row;
}
.left {
height: 100%;
display: block;
width: 50%;
background-color: green;
overflow-y: scroll;
}
.right {
height: 100%;
background-color: red;
display: block;
width: 50%;
overflow-y: scroll;
}
</style>
</head>
<body>
<div class="container">
<div class="left">Text</div>
<div class="right">Text</div>
</div>
</body>
</html>
,我将如何让每个 div 标签占据页面/视口的整个高度(以便绿色和红色一直延伸到页面,即使 div 中的内容很少)?
UYOU
万千封印
相关分类