Foundation 網格 - 小型設備
假設我們在小型裝置上有一個簡單的網格佈局,兩列,寬度比例為 25% 和 75%。
提示: 小型裝置的定義是螢幕小於 40.0625em
。
小型裝置上我們使用 .small-*
類別。
<div class="small-3 columns">....</div> <div class="small-9 columns">....</div>
以下實例設定了兩個列,比例為25% 和75% (Foundation 是移動優先: 如果沒有特別說明,在大型裝置上會繼承.small 類別的程式碼):. small
in them and use those".
實例
#
<!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://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <div class="row"> <h2>Foundation 网格</h2> <p>25%/75% 比例。</p> <p>重置浏览器窗口大小查看效果。</p> <div class="small-3 columns" style="background-color:yellow;"> <p>php中文网</p> </div> <div class="small-9 columns" style="background-color:pink;"> <p>php中文网</p> </div> </div> </body> </html>
運行實例»##點擊"運行實例" 按鈕查看線上實例
#注意: 要保證數列加起來是12 列! |
.small-4 和
.small-8:
實例
運行實例»點擊"運行實例" 按鈕查看線上實例
<!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://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <div class="row"> <h2>Foundation 网格</h2> <p>33.3%/66.6% 比例。</p> <p>重置浏览器窗口大小查看效果。</p> <div class="small-4 columns" style="background-color:yellow;"> <p>php中文网</p> </div> <div class="small-8 columns" style="background-color:pink;"> <p>php中文网</p> </div> </div> </body> </html>
運行實例»點擊"運行實例" 按鈕查看線上實例