Offsets
优质
小牛编辑
128浏览
2023-12-01
描述 (Description)
使用large-offset-*或small-offset-*类,可以将列向右移动。 在*定义类时,列的左边距增加了指定的数字。 例如,large-offset-4。
例子 (Example)
以下示例演示了在Foundation中使用offsets -
<!DOCTYPE html>
<html>
<head>
<title>Foundation Template</title>
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
<link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
<script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
<script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></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>