<!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>
.flex-container{
width: 600px;
height: 500px;
background-color: aqua;
display: flex;
/* 子盒子纵向排列 */
/* flex-direction: column; */
}
.flex-container div{
border: 5px #ccc solid ;
background-color: orange;
}
.box1{
flex: 1;
}
.box2{
flex: 2;
display: flex;
flex-direction: column;
}
</style>
</head>
<body>
<div class="flex-container">
<div class="box1">1</div>
<div class="box2">
<div class="box1">2</div>
<div class="box2">3</div>
</div>
<!-- <div class="box1">3</div> -->
</div>
</body>
</html>
看完必会的flex布局
于 2023-09-12 11:51:58 首次发布