Foundation 按钮
Foundation 使用 .button
CSS 样式类来设置按钮
.button
类创建了一个蓝色的按钮并附有内边距
<button type="button" class="button">Default</button>
按钮样式
Foundation 提供了 6 种按钮样式
.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>
按钮元素
.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
类可以设置按钮外观为圆形
<button type="button" class="button">Default Button</button> <button type="button" class="button radius">Radius Button</button>
圆形按钮
.round
类可以设置按钮的外观为圆形
<button type="button" class="button">Default 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>