按钮Button

支持<a>、<button>、<input>[submit,reset]元素

按扭 Button - 图1

  1. a:
  2. <a href="#" class="btn">Button</a>
  3. button:
  4. <button type="button" class="btn">Button</button>
  5. <button type="submit" class="btn">Submit</button>
  6. <button type="reset" class="btn">Reset</button>
  7. input:
  8. <input type="submit" value="Submit" class="btn">
  9. <input type="reset" value="Reset" class="btn">

自定义Custom

以下所有属性都可以叠加使用

添加class="xs"转换为小按钮,添加class="xl"转换为大按钮

按扭 Button - 图2

  1. <button type="button" class="btn">Default</button>
  2. <button type="button" class="btn xs">Small</button>
  3. <button type="button" class="btn xl">Large</button>

自定义背景颜色属性,更多颜色属性请至属性中查询

按扭 Button - 图3

  1. <button type="button" class="btn xs bg-red">Red</button>
  2. <button type="button" class="btn xs bg-orange">Orange</button>
  3. <button type="button" class="btn xs bg-green">Green</button>
  4. <button type="button" class="btn xs bg-blue">Blue</button>
  5. <button type="button" class="btn xs bg-pink">Pink</button>

可添加图标(input元素的按钮不支持添加图标),添加class="disabled"转换为禁用按钮,添加class="square"转换为直角按钮

按扭 Button - 图4

  1. <button type="button" class="btn"><i class="flaticon-user151 mr3"></i>Icon and Text</button>
  2. <button type="button" class="btn"><i class="flaticon-picture28"></i></button>
  3. <button type="button" class="btn disabled">Disabled</button>
  4. <button type="button" class="btn square">Square</button>

添加class="line"转换为width:100%

按扭 Button - 图5

  1. <button type="button" class="btn line">Line</button>

按钮组Button Group

添加父级元素<div class="btn-group">,将按钮群体转换为一个组件

按扭 Button - 图6

  1. <div class="btn-group">
  2. <button type="button" class="btn">Button1</button>
  3. <button type="button" class="btn">Button2</button>
  4. <button type="button" class="btn">Button3</button>
  5. </div>

添加class="vertical"转换为垂直排列

按扭 Button - 图7

  1. <div class="btn-group vertical">
  2. ...
  3. </div>

添加class="square"转换为直角按钮

按扭 Button - 图8

  1. <div class="btn-group square">
  2. ...
  3. </div>

叠加按钮的私有属性,其中class="square"与class="line"将无效

按扭 Button - 图9

按扭 Button - 图10

  1. <div class="btn-group">
  2. <button type="button" class="btn xl">Button1</button>
  3. <button type="button" class="btn xl disabled">Button2</button>
  4. <button type="button" class="btn xl">Button3</button>
  5. </div>
  6. <div class="btn-group">
  7. <button type="button" class="btn xs bg-navy icon"><i class="flaticon-picture28"></i></button>
  8. <button type="button" class="btn xs bg-navy icon"><i class="flaticon-play87"></i></button>
  9. <button type="button" class="btn xs bg-navy icon"><i class="flaticon-settings46"></i></button>
  10. </div>

自定义风格Custom Style

可以使用自定义风格工具快速创建CSS

按扭 Button - 图11

按扭 Button - 图12

按扭 Button - 图13

  1. <button type="button" class="btn mystyle">Button</button>
  2. <div class="btn-group mystyle">
  3. <button type="button" class="btn mystyle">Button1</button>
  4. <button type="button" class="btn mystyle">Button2</button>
  5. <button type="button" class="btn mystyle">Button3</button>
  6. </div>
  7. <div class="btn-group vertical mystyle">
  8. <button type="button" class="btn mystyle">Button1</button>
  9. <button type="button" class="btn mystyle">Button2</button>
  10. <button type="button" class="btn mystyle">Button3</button>
  11. </div>