通过将按钮类添加到 <a>, <button>, <input> 来实现按钮样式
<a href="#" role="button">Link</a> <button type="submit">Button</button> <input type="button" value="Input"> <input type="submit" value="Submit">
仅仅 <button> 适用于导航条以及导航条控件
如果 <a> 被作为按钮使用而不是链接, 请注意添加 role="button"
高度推荐使用 <button>
选项
<!-- Standard button --> <button type="button">Default</button> <!-- Provides extra visual weight and identifies the primary action in a set of buttons --> <button type="button">Primary</button> <!-- Indicates a successful or positive action --> <button type="button">Success</button> <!-- Contextual button for informational alert messages --> <button type="button">Info</button> <!-- Indicates caution should be taken with this action --> <button type="button">Warning</button> <!-- Indicates a dangerous or potentially negative action --> <button type="button">Danger</button> <!-- Deemphasize a button by making it look like a link while maintaining button behavior --> <button type="button">Link</button>
尺寸
通过添加 .btn-lg , .btn-sm , .btn-xs 来实现尺寸
<p> <button type="button">Large button</button> <button type="button">Large button</button> </p> <p> <button type="button">Default button</button> <button type="button">Default button</button> </p> <p> <button type="button">Small button</button> <button type="button">Small button</button> </p> <p> <button type="button">Extra small button</button> <button type="button">Extra small button</button> </p>
通过添加 .btn-block 来实现块级按钮
<button type="button">Block level button</button> <button type="button">Block level button</button>
激活状态
<button type="button">Primary button</button> <button type="button">Button</button>
禁用状态
IE9以下无法兼容
<button type="button" disabled="disabled">Primary button</button> <button type="button" disabled="disabled">Button</button>
以上所述是小编给大家介绍的Bootstrap 3 按钮标签实例代码,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!
您可能感兴趣的文章: