VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > 网站开发 > HTML >
  • HTML5 教程之Foundation 按钮

按钮样式

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

实例


  1. <button type="button" class="button">Default</button>
  2. <button type="button" class="button secondary">Secondary</button>
  3. <button type="button" class="button success">Success</button>
  4. <button type="button" class="button info">Info</button>
  5. <button type="button" class="button warning">Warning</button>
  6. <button type="button" class="button alert">Alert</button>
复制
实例预览 »

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

实例


  1. <a href="#" class="button info" role="button">Link Button</a>
  2. <button type="button" class="button info">Button</button>
  3. <input type="button" class="button info" value="Input Button">
  4. <input type="submit" class="button info" value="Submit Button">
复制
实例预览 »

 

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

按钮大小

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

实例


  1.  <button type="button" class="button large">Large</button>
  2. <button type="button" class="button">Default</button>
  3. <button type="button" class="button small">Small</button>
  4. <button type="button" class="button tiny">Tiny</button>
复制
实例预览 »

圆角按钮

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

实例


  1. <button type="button" class="button">Default Button</button>
  2. <button type="button" class="button radius">Radius Button</button>
  3. <button type="button" class="button round">Round Button</button>
复制
实例预览 »

延展按钮

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

实例


  1. <button type="button" class="button">Default Button</button>
  2. <button type="button" class="button expand">Expanded Button</button>
复制
实例预览 »

禁用按钮

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

实例


  1. <button type="button" class="button">Default Button</button>
  2. <button type="button" class="button disabled">Disabled Button</button>
复制
实例预览 »
 

相关教程