
- 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 - 運動 UI
- Foundation 實用資源
- Foundation - 快速指南
- Foundation - 實用資源
- Foundation - 討論
Foundation - 全域性樣式顏色
描述
諸如連結和按鈕等互動元素使用 SASS 變數 $primary-color 提供的預設藍色色調。元件還可以具有諸如二級、警告、成功和警告等顏色。您可以使用其他顏色搭配 UI 元素。
示例
以下示例演示了在 Foundation 中使用顏色。
<html> <head> <title>Foundation Example</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 = "success callout"> <p>This is success callout.</p> </div> <div class = "alert callout"> <p>This is alert callout.</p> </div> <button class = "button">Primary Action</button> <button class = "button secondary">Secondary Action</button> <button class = "button success">Success Action</button> <button class = "button warning">Warning Action</button> <button class = "button alert">Alert Action</button> </body> </html>
輸出
讓我們執行以下步驟來了解以上給定程式碼的工作方式 −
將上面給定的 html 程式碼儲存為 global_styles_color.html 檔案。
在瀏覽器中開啟此 HTML 檔案,輸出如下所示。
foundation_global_styles.htm
廣告