源代码:
提交运行 »
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://www.fmpq.com/jscss/bootstrap/foundation.min.css"> <script src="http://www.fmpq.com/jscss/bootstrap/jquery.min.js"></script> <script src="http://www.fmpq.com/jscss/bootstrap/foundation.min.js"></script> <script src="http://www.fmpq.com/jscss/bootstrap/modernizr.js"></script> </head> <body> <div class="row"> <h2>网格 - 居中列</h2> <p>列居中可以使用 <code>.small-centered</code> 类。中型和大型设备可以继承小型设备的居中,但你需要在大型设备上设置居中类<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> </body> </html>
测试结果: