- 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 - Motion UI
- Foundation 實用資源
- Foundation - 快速指南
- Foundation - 實用資源
- Foundation - 討論
Foundation - 尺寸類
說明
你可以使用的 .tiny、.small 或 .large 類來更改開關的尺寸。
示例
以下示例演示瞭如何在 Foundation 中更改 開關尺寸。
<html>
<head>
<title>Sizing Classes</title>
<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 = "switch tiny">
<input class = "switch-input" id = "tinySwitch" type = "checkbox" name = "demoSwitch">
<label class = "switch-paddle" for = "tinySwitch">
<span class = "show-for-sr">Tiny Switch</span>
</label>
</div>
<div class = "switch small">
<input class = "switch-input" id = "smallSwitch" type = "checkbox" name = "demoSwitch">
<label class = "switch-paddle" for = "smallSwitch">
<span class = "show-for-sr">Small Switch</span>
</label>
</div>
<div class = "switch large">
<input class = "switch-input" id = "largeSwitch" type = "checkbox" name = "demoSwitch">
<label class = "switch-paddle" for = "largeSwitch">
<span class = "show-for-sr">Large Switch</span>
</label>
</div>
<script>
$(document).ready(function() {
$(document).foundation();
})
</script>
</body>
</html>
輸出
讓我們執行以下步驟,看看上面給出的程式碼如何工作 −
儲存上面給出的 HTML 程式碼 radio_switch_sizing_classes.html 檔案。
在這款 HTML 檔案在瀏覽器中開啟,一個輸出將顯示如下所示。
foundation_basic_controls.htm
廣告