css3弹性盒子如何布局

来源:互联网 发布:windows sdk for win7 编辑:程序博客网 时间:2024/05/22 03:06
【属性flex-direction:row,row-reverse,column,colmn-reverse】<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Document</title><style type="text/css">.container{display: -webkit-flex;display: flex; /*-webkit-flex-direction:row-reverse;*/【使用flex-direction属性,将能控制子元素盒子排序】               /*flex-direction: row-reverse;*/width: 400px;height: 250px;background-color:lightblue;}.flex-item{width: 100px;height: 100px; margin: 10px; background-color: lightyellow;}</style></head><body><div class="container"><div class="flex-item">盒子1</div><div class="flex-item">盒子2</div><div class="flex-item">盒子3</div></div></body></html>

正常排序

使用flex-direction:row-reverse之后的排序

0 0
原创粉丝点击