Foundation Grid - Small Devices
Suppose we have a simple grid layout on a small device, with two columns and a width ratio of 25% and 75%.
Tip: A small device is defined as a screen smaller than 40.0625em
.
On small devices we use the .small-*
class.
<div class="small-3 columns">....</div> <div class="small-9 columns">....</div>
The following example sets two columns with a ratio of 25% and 75% (Foundation is mobile first: if not specified, the code of the .small class will be inherited on large devices):. small
in them and use those".
Instance
<!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>
Run Instance»
Click "Run Instance " button to view online examples
Note: Make sure the number series adds up to 12 columns! |
If you need to set the ratio of 33.3%/66.6%, you can use .small-4
and .small-8
:
Instance
<!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>
Run Instance»
Click the "Run Instance" button to view the online instance