Foundation 按钮

🌙
手机阅读
本文目录结构

Foundation 按钮


按钮样式

Foundation 提供了 6 种按钮样式。 .button 类创建了一个蓝色的按钮并附有内边距。不同颜色按钮类为: .secondary, .success, .info, .warning.alert:

<button type="button" class="button">Default</button>
<button type="button" class="button secondary">Secondary</button>
<button type="button" class="button success">Success</button>
<button type="button" class="button info">Info</button>
<button type="button" class="button warning">Warning</button>
<button type="button" class="button alert">Alert</button>

按钮类可以使用在 <a>, <button>, 或 <input> 元素:

<a href="#" class="button info" role="button">Link Button</a>
<button type="button" class="button info">Button</button>
<input type="button" class="button info" value="Input Button">
<input type="submit" class="button info" value="Submit Button">

**为什么将 a 标签的 href 设置为 # ? **
当我们不希望链接点击跳转并得到 “404” 页面时,我们可以将 a 标签的 href 设置为 #。


按钮大小

我们可以使用 .large, .small.tiny 类来设置按钮大小:

<button type="button" class="button large">Large</button>
<button type="button" class="button">Default</button>
<button type="button" class="button small">Small</button>
<button type="button" class="button tiny">Tiny</button>

圆角按钮

可以使用 .radius.round 类来设置圆角按钮:

<button type="button" class="button">Default Button</button>
<button type="button" class="button radius">Radius Button</button>
<button type="button" class="button round">Round Button</button>

延展按钮

可以使用 .expand 类来设置按钮的宽度为 100%:

<button type="button" class="button">Default Button</button>
<button type="button" class="button expand">Expanded Button</button>

禁用按钮

可以使用 .disabled 类来设置按钮不可点击:

<button type="button" class="button">Default Button</button>
<button type="button" class="button disabled">Disabled Button</button>

AXIHE / 精选资源

浏览全部教程

面试题

学习网站

前端培训
自己甄别

前端书籍

关于朱安邦

我叫 朱安邦,阿西河的站长,在杭州。

以前是一名平面设计师,后来开始接接触前端开发,主要研究前端技术中的JS方向。

业余时间我喜欢分享和交流自己的技术,欢迎大家关注我的 Bilibili

关注我: Github / 知乎

于2021年离开前端领域,目前重心放在研究区块链上面了

我叫朱安邦,阿西河的站长

目前在杭州从事区块链周边的开发工作,机械专业,以前从事平面设计工作。

2014年底脱产在老家自学6个月的前端技术,自学期间几乎从未出过家门,最终找到了满意的前端工作。更多>

于2021年离开前端领域,目前从事区块链方面工作了