揭秘CSS(第 1 版)
9.3.3 弹性容器的属性
阅读( )
justify-content:space-between 效果演示
属性取值:
HTML代码:
<div class="father"> <div class="box1">1</div> <div class="box2">2</div> <div class="box3">3</div> </div>
CSS代码:
.father { color: #fff; text-align: center; font: bold 36px/36px monaco; } .father { width: 180px; display: flex; flex-wrap: wrap; justify-content: space-between; border: 1px solid #ef39d5; } .father > div { width: 70px; } .box1 { background: rgb(127, 63, 253); } .box2 { background: rgb(239, 57, 213); } .box3 { background: rgb(27, 185, 241); }
运行效果:
1
2
3