grid网格布局方案
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.wrap{
width: 1000px;
height: 500px;
background: yellow;
display: grid;
grid-template-rows: 1fr 2fr 1fr;
grid-template-columns: 100px auto 200px;
grid-template-areas: "box1 box1 box1"
"box2 box2 box3"
"box2 box2 box3";
}
.wrap div{
background: lightblue;
border: 1px solid #000;
}
.wrap div:nth-child(1){
grid-area: box1;
}
.wrap div:nth-child(2){
grid-area: box2;
}
.wrap div:nth-child(3){
grid-area: box3;
}
</style>
</head>
<body>
<div class="wrap">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
</body>
</html>
本文来自博客园,作者:JackieDYH,转载请注明原文链接:https://www.cnblogs.com/JackieDYH/p/17634884.html