首先想到额是table:
1.用table标签可以很方便做一个3×3的表格:
<div class="container">
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
2.使用css设置表格属性:
<style type="text/css">
.container {
width: 100%;
line-height: 100%;
}
table {
width: 100%;
height: 90vw;
border-spacing: 4vw;
}
td {
background-color: yellow;
}
<!--table的width属性表示其宽度占其容器宽的100%&