简单教程
提交运行
代码编辑器:
<!DOCTYPE html> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdn.bootcss.com/foundation/5.5.3/css/foundation.min.css"> <div class="row"> <h2>网格 - 居中列</h2> <p>列居中可以使用 <code>.small-centered</code> 类</p> <p>中型和大型设备可以继承小型设备的居中,但需要在大型设备上设置居中类<code>.large-centered</code></p> <p>改变浏览器窗口大小查看效果</p> <div class="small-4 small-centered columns" style="background-color:yellow;">small-4 small-centered</div> </div> <div class="row"> <div class="small-6 small-centered columns" style="background-color:pink;">small-6 small-centered</div> </div> <div class="row"> <div class="small-6 large-centered columns" style="background-color:lightgreen;">small-6 large-centered</div> </div> <div class="row"> <div class="small-8 small-centered large-uncentered columns" style="background-color:yellow;">small-8 small-centered large-uncentered</div> </div> <div class="row"> <div class="small-10 small-centered columns" style="background-color:pink;">small-10 small-centered</div> </div>
运行结果: