<style>
.box{
height: 300px;
width: 500px;
background-color: #f3f;
margin: 0 auto;
}
.xiaobox1,.xiaobox2,.xiaobox3{
height: 100px;
width: 100px;
}
.box{
/* 开启flex */
display: flex;
}
.xiaobox1{
background-color: #f00;
/*
flex-basis:可以覆盖前面的宽度,
也就是说可以给自己单独设置宽度.
*/
flex-basis: 200px;
}
.xiaobox2{
background-color: #00f;
}
.xiaobox3{
background-color: #0f0;
}
</style>
</head>
<body>
<div class="box">
<div class="xiaobox1">xiaobox1</div>
<div class="xiaobox2">xiaobox2</div>
<div class="xiaobox3">xiaobox3</div>
</div>
</body>
07-21
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交