Foundation - 按钮着色
描述
按钮可以着色以赋予其额外的含义。可以使用 .disabled 类禁用按钮,该类将按钮显示为淡入淡出,并且不会禁用控件。如果要禁用 <button> 元素,请向其添加 disabled 属性。如果要禁用链接,请添加 aria-disabled 属性。
示例
以下示例演示了如何在 Foundation 中为按钮着色。
<html>
<head>
<title>Button Coloring</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites@6.5.1/dist/css/foundation.min.css" integrity="sha256-1mcRjtAxlSjp6XJBgrBeeCORfBp/ppyX4tsvpQVCcpA= sha384-b5S5X654rX3Wo6z5/hnQ4GBmKuIJKMPwrJXn52ypjztlnDK2w9+9hSMBz/asy9Gw sha512-M1VveR2JGzpgWHb0elGqPTltHK3xbvu3Brgjfg4cg5ZNtyyApxw/45yHYsZ/rCVbfoO5MSZxB241wWq642jLtA==" crossorigin="anonymous">
</head>
<body>
<a class = "secondary button" href = "#">Secondary</a>
<button type = "button" class = "success button">Success</button>
<button type = "button" class = "alert button">Alert</button>
<a class = "warning button" href = "#">Warning</a>
<a class = "disabled button" href = "#">Disabled</a>
<button type = "button" class = "disabled button">Disabled</button>
<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_coloring.html 文件。
在浏览器中打开此 HTML 文件,将显示如下所示的输出。
foundation_basic_controls.html

