Foundation Block Grid
The block grid is used to evenly divide the page content: for example, if you want to display four pictures in one row, the width needs to be equally divided regardless of the screen.
Blocks can be created using the <ul>
element plus the .small|medium|large-block-grid-num
class grid. num is used to specify the number of equal shares:
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 style="padding:20px;"> <h2>Foundation 块状网格</h2> <p>图片均分屏幕宽度:</p> <ul class="small-block-grid-3"> <li><img src="newyork.jpg" alt="New York" width="400" height="300"></li> <li><img src="paris.jpg" alt="Paris" width="400" height="300"></li> <li><img src="sanfran.jpg" alt="San Francisco" width="400" height="300"></li> </ul> </body> </html>
Run Example»
Click the "Run Instance" button to view the online instance
Another instance, use the paragraph:
Example
<!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 style="padding:20px;"> <h2>Foundation 块状网格</h2> <p>均分段落:</p> <ul class="small-block-grid-3"> <li><p>Just a Simple Example Text...</p></li> <li><p>Just a Simple Example Text...</p></li> <li><p>Just a Simple Example Text...</p></li> </ul> </body> </html>
RunInstance»
Click the "Run Instance" button to view the online instance
Different size screens display different quantities
By adding multiple grid blocks The class can set different screen sizes to display different number of blocks:
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 style="padding:20px;"> <h2>Foundation 块状网格</h2> <p>通过添加多个块类,在不同屏幕指定不同是均分数量:</p> <ul class="small-block-grid-2 medium-block-grid-3 large-block-grid-4"> <li><img src="newyork.jpg" alt="New York" width="400" height="300"></li> <li><img src="paris.jpg" alt="Paris" width="400" height="300"></li> <li><img src="sanfran.jpg" alt="San Francisco" width="400" height="300"></li> <li><img src="newyork.jpg" alt="New York" width="400" height="300"></li> </ul> </body> </html>
Run instance»
Click "Run" Example" button to view online examples