<!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>
.box{
width: 550px;
height: 400px;
background-color: orange;
margin: 0 auto;
/* 1 开启flex 布局*/
display: flex;
}
.item{
width: 100px;
height: 100px;
line-height: 100px;
color: #fff;
text-align: center;
}
/* flex-basis 单独设置每个 item 的宽度 */
.item1{
background-color: #f00;
flex-basis: 200px;
}
.item2{
background-color: #0f0;
}
.item3{
background-color: #00f;
}
</style>
</head>
<body>
<div class="box">
<div class="item item1">item1</div>
<div class="item item2">item2</div>
<div class="item item3">item3</div>
</div>
</body>
</html>