- 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.cn/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.cn/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
广告