需求:多个div从下往上布局 ,div垂直居中html
任何一个容器能够指定为flex布局,可是td和th等标签自己已有布局,因此重写display属性会使元素失去原有的布局特性布局
*{flex
display:flexspa
}code
任何一个被设置为弹性布局的容器会有两条抽象的轴,弹性布局的容器的有如下属性htm
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> .container{ width:500px; height:500px; border: 1px solid #0e90d2; display: flex; flex-direction:row-reverse; } .box{ width:200px; height:200px; background:#bbbbbb; } </style> </head> <body> <div class="container"> <div class="box"> 1 </div> <div class="box"> 2 </div> <div class="box"> 3 </div> <div class="box"> 4 </div> <div class="box"> 5 </div> </div> </body> </html>