<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>九宫格布局</title>
</head>
<body>
<pre>
九宫格布局
flex-direction属性决定主轴的方向(即项目的排列方向):(左中右 上中下)
flex-direction: row | row-reverse | column | column-reverse;
</pre>
<style>
.rongqi01{ width:250px; height:250px; background-color:#CCC; display:flex; flex-direction: column; }
.rongqi02{ display:flex;}
.xm{ width:70px; height:70px; margin:5px; background-color:#0CF;}
</style>
<div class="rongqi01">
<div class="rongqi02">
<div class="xm">01</div>
<div class="xm">02</div>
<div class="xm">03</div>
</div>
<div class="rongqi02">
<div class="xm">04</div>
<div class="xm">05</div>
<div class="xm">06</div>
</div>
<div class="rongqi02">
<div class="xm">07</div>
<div class="xm">08</div>
<div class="xm">09</div>
</div>
</div><hr>
<style>
.rongqi03{ width:250px; height:250px; background-color:#CCC; display:flex; flex-wrap:wrap;}
</style>
<div class="rongqi03">
<div class="xm">01</div>
<div class="xm">02</div>
<div class="xm">03</div>
<div class="xm">04</div>
<div class="xm">05</div>
<div class="xm">06</div>
<div class="xm">07</div>
<div class="xm">08</div>
<div class="xm">09</div>
</div>
</body>
</html>