CSS display:table使用示例





<style type="text/css">
.table {display:table; text-align:center;}
.row {display:table-row;}
.cell {display:table-cell; vertical-align:middle; width:100px; height:100px; background-color:#063; border:1px solid #000;}
</style>

<div class="table">
  <div class="row">
    <div class="cell">1</div>
    <div class="cell">2</div>
    <div class="cell">3</div>
  </div>
  <div class="row">
    <div class="cell">4</div>
    <div class="cell">5</div>
    <div class="cell">6</div>
  </div>
  <div class="row">
    <div class="cell">7</div>
    <div class="cell">8</div>
    <div class="cell">9</div>
  </div>
</div>


评论: 0 | 引用: 0 | 查看次数: 642
发表评论
登录后再发表评论!