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="http://www.php.cn/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>

運行實例»
##點擊"運行實例"按鈕查看線上實例