如何使用css和js将页面分4个div上下平分,左大右小,且跟随窗口和屏幕大小缩放。
.box{
height:100%;
height:100%}
.left_one{
}
.left_two{
}
.right_one{
}
.right_two{
}
如何使用css和js将页面分4个div上下平分,左大右小,且跟随窗口和屏幕大小缩放。
.box{
height:100%;
height:100%}
.left_one{
}
.left_two{
}
.right_one{
}
.right_two{
}
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
.box{
background-color: #F2F2F2;
height: 100vh;
display: grid;
grid-template-columns: 3fr 2fr;
grid-template-rows: 1fr 1fr;
}
.box>div {
background-color: #D9D9D9;
margin: 10px;
}
</style>
</head>
<body>
<div class="box">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</body>
</html>