<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
.box{
width: 500px;
height: 500px;
border: 2px solid black;
margin: 0 auto;
display: flex;
flex-direction: row-reverse;
/**
* flex-direction: row; 主軸是行(默認)
* flex-direction: column; 主軸是列
* flex-direction: row-reverse; 從右向左排
* flex-direction: column-reverse; 從下向上排
*/
}
.box div{
width: 100px;
height: 100px;
border: 1px dashed red;
}
</style>
</head>
<body>
<div class="box">
<div>111</div>
<div>222</div>
<div>333</div>
<div>444</div>
</div>
</body>
</html>
上一篇:[css3中新增彈性盒]
