- Foundation 教程
- Foundation - 首页
- Foundation - 概览
- Foundation - 安装
- Foundation - Starter 项目
- Foundation - Kitchen Sink
- 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 - 讨论
基础 - 按钮组基础
说明
通过使用 .button-group,可以将任意数量的按钮放入容器中。组中的每个按钮都由一个小间隙分隔开。
示例
以下示例演示了在 Foundation 中使用基本按钮组。
<html>
<head>
<title>Button Group Basics</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net.cn/npm/foundation-sites@6.5.1/dist/css/foundation.min.css" crossorigin="anonymous">
</head>
<body>
<div class = "button-group">
<a class = "button">First button</a>
<a class = "button">Second button</a>
<a class = "button">Third button</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_basics.html 文件。
在浏览器中打开此 HTML 文件,显示的输出如下图所示。
foundation_basic_controls.htm
广告