- 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 Mixin
- Foundation 庫
- Foundation - Motion UI
- Foundation 有用資源
- Foundation - 快速指南
- Foundation - 有用資源
- Foundation - 討論
基礎 - 按鈕組配色
說明
按鈕組中的每個按鈕都可以單獨配色,也可以使用相同的類為每個按鈕配色。
範例
以下示例演示如何在 Foundation 中為按鈕組配色。
<html>
<head>
<title>Button Group Coloring</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites@6.5.1/dist/css/foundation.min.css" crossorigin="anonymous">
</head>
<body>
<div class = "button-group">
<a class = "secondary button">Secondary</a>
<a class = "success button">Success</a>
<a class = "warning button">Warning</a>
<a class = "alert button">Alert</a>
</div>
<div class = "success button-group">
<a class = "button">Button</a>
<a class = "button">With</a>
<a class = "button">Success</a>
<a class = "button">Class</a>
</div>
<script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
<script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
<script>
$(document).ready(function() {
$(document).foundation();
})
</script>
</body>
</html>
輸出
讓我們執行以下步驟,看看上面給出的程式碼是如何工作的 −
儲存上面給出的 html 程式碼 button_group_coloring.html 檔案。
在瀏覽器中開啟此 HTML 檔案,輸出如下所示。
foundation_basic_controls.htm
廣告