- Foundation 教程
- Foundation - 主頁
- Foundation - 概述
- Foundation - 安裝
- Foundation - starter 專案
- Foundation - 立竿見影
- Foundation 通用
- Foundation - 全域性樣式
- Foundation - Sass
- Foundation - JavaScript
- Foundation - JavaScript 實用程式
- Foundation - 媒體查詢
- Foundation - 網格
- Foundation - flex 網格
- Foundation - 表單
- Foundation - 可見性類
- Foundation - 基礎版印刷體
- Foundation - 印刷體幫助
- Foundation - 基本控制元件
- Foundation - 導航
- Foundation - 容器
- Foundation - 媒體
- Foundation - 外掛
- Foundation SASS
- Foundation - Sass 函式
- Foundation - Sass 組合
- Foundation 庫
- Foundation - Motion UI
- Foundation 有用資源
- Foundation - 快速指南
- Foundation - 有用資源
- Foundation - 討論
Foundation - 巢狀
說明
我們可以把網格列巢狀到列中。在一列中,我們可以在其中定義更多列。
示例
以下示例演示了在 Foundation 中使用巢狀的方式 −
<!DOCTYPE html>
<html>
<head>
<title>Foundation Template</title>
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites@6.5.1/dist/css/foundation.min.css" crossorigin="anonymous">
<!-- Compressed JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/foundation-sites@6.5.1/dist/js/foundation.min.js" crossorigin="anonymous"></script>
</head>
<body>
<div class = "row">
<h2>Grid - Nested Columns</h2>
<div class = "small-9 columns" style = "background-color:#8BD6EE;">
<h4>Main column small-9</h4>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
<div class = "row">
<div class = "small-6 columns" style = "background-color:#808000;">
Nested inside the small-9 class
</div>
<div class = "small-6 columns" style = "background-color:#FF6347;">
Nested inside the small-9 class
</div>
</div>
</div>
<div class = "small-3 columns" style = "background-color:#808000;">Column small-3 class
<div class = "row">
<div class = "small-8 columns" style = "background-color:#7B68EE;">
Nested inside small-3 class
</div>
</div>
</div>
</div>
</body>
</html>
輸出
讓我們執行以下步驟,瞭解上述程式碼如何工作 −
儲存上述 HTML 程式碼為 nested.html 檔案。
在瀏覽器中開啟這個 HTML 檔案,結果如下所示。
foundation_the_grid.htm
廣告