Foundation 中文手冊
/ Foundation 面板
Foundation 面板
Foundation 面板是一个灰色边框,内容含有内边距的模块。可以使用 .panel
类来创建:
实例
<!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 style="padding:20px;"> <h2>面板</h2> <div class="panel"> <h3>标题</h3> <p>文本内容..</p> </div> </div> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例
面板颜色
使用 .callout
类将面板颜色修改为浅蓝:
实例
<!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 style="padding:20px;"> <h2>面板颜色修改</h2> <div class="panel callout"> <h3>标题</h3> <p>文本内容..</p> </div> </div> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例
圆角面板
使用 .radius
类将面板设置为圆角:
实例
<!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 style="padding:20px;"> <h2>圆角面板 Panel</h2> <div class="panel radius"> <h3>标题</h3> <p>文本内容..</p> </div> </div> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例
自定义面板
可以使用 CSS 来自定义面板,以下实例中我们将面板作为一个卡片:
实例
<!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> <style> body { padding: 20px; } .panel { padding: 0; border: none; width: 50%; } div.container { text-align: center; padding: 15px; margin-top: 20px; } img { width: 100%; } </style> </head> <body> <h2>Customized Panels</h2> <div class="panel"> <img src="//m.sbmmt.com/wp-content/uploads/2015/11/20121204024112919.jpg" alt="Cinque Terre" width="400" height="300"> <div class="container"> <h4>长城</h4> <p>不到长城非好汉!!!</p> </div> </div> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例