Bootstrap 按钮的尺寸

Bootstrap提供了 3 个相对尺寸的类,用来设置按钮的尺寸。如果希望比默认按钮大一些,使用 .btn-large 类;希望比默认按钮小一些,使用 .btn-mini 或 .btn-small 类。如:

 
  
  1.   class="btn btn-large btn-primary" type="button">Large button
  2.   class="btn btn-large" type="button">Large button
  3.   class="btn btn-primary" type="button">Default button
  4.   class="btn" type="button">Default button
  5.   class="btn btn-small btn-primary" type="button">Small button
  6.   class="btn btn-small" type="button">Small button
  7.   class="btn btn-mini btn-primary" type="button">Mini button
  8.   class="btn btn-mini" type="button">Mini button

效果如图 3‑57所示:

Bootstrap 按钮的尺寸_第1张图片图3-57 Bootstrap按钮尺寸

如果想创建一个“块级”按钮,也没问题,只需添加 .btn-block 类。此时,按钮的宽度就会是 100%。如:

 
  
  1. class="btn btn-large btn-primary btn-block" type="button">Block level button
  2. class="btn btn-large btn-block" type="button">Block level button

效果如图 3‑58所示:

Bootstrap 按钮的尺寸_第2张图片图3-58 Bootstrap块级按钮

关于作者

歪脖先生,十五年以上软件开发经验,酷爱Web开发,精通 HTML、CSS、JavaScript、jQuery、JSON、Python、Less、Bootstrap等,著有《HTML宝典》、《揭秘CSS》、《Less简明教程》、《JSON教程》、《Bootstrap2用户指南》、《Bootstrap3实用教程》,并全部在 GitHub 上开源。

你可能感兴趣的:(Bootstrap,Bootstrap,按钮的尺寸,Bootstrap,按钮,Bootstrap,教程,Bootstrap,教程)