- Foundation 常規
- Foundation - 全域性樣式
- Foundation - Sass
- Foundation - JavaScript
- Foundation - JavaScript 實用工具
- Foundation - 媒體查詢
- Foundation - 網格
- Foundation - 彈性網格
- Foundation - 表格
- Foundation - 可視性類
- Foundation - 基本排版
- Foundation - 排版幫助
- Foundation - 基本控制元件
- Foundation - 導航
- Foundation - 容器
- Foundation - 媒體
- Foundation - 外掛
- Foundation SASS
- Foundation - Sass 函式
- Foundation - Sass 混合
- Foundation 庫
- Foundation - 動態 UI
- Foundation 實用資源
- Foundation - 快速指南
- Foundation - 實用資源
- Foundation - 討論
Foundation - 偏移
說明
使用 large-offset-* 或 small-offset-* 類,您可以將列向右移動。在 * 中定義類時,列的左邊緣會增加指定數量。例如,large-offset-4。
示例
以下示例演示瞭如何在 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>
<h2>Grid - Offsets</h2>
<div class = "row">
<div class = "large-2 columns" style = "background-color:#808000;">
Two column
</div>
<div class = "large-10 columns" style = "background-color:#7B68EE;">
10 columns
</div>
</div>
<div class = "row">
<div class = "large-2 columns" style = "background-color:#8BD6EE;">
Two columns
</div>
<div class = "large-8 small-offset-2 columns" style = "background-color:#C0B0F0;">
8 column, offset 2 column
</div>
</div>
<div class = "row">
<div class = "large-3 columns" style = "background-color:#808000;">
3 columns
</div>
<div class = "large-5 small-offset-4 columns" style = "background-color:#8BD6EE;">
5 columns, offset 4 column
</div>
</div>
</body>
</html>
輸出
讓我們執行以下步驟,瞭解上述給定程式碼如何工作 −
將上述給定的 html 程式碼儲存為 offsets.html 檔案。
在瀏覽器中開啟此 HTML 檔案,顯示如下所示的輸出。
foundation_the_grid.htm
廣告