Bootstrap CSS 按钮参考


按钮颜色


按钮尺寸


活动/禁用按钮


块级按钮


按钮组


按钮类

下面的类可用于设置任何 <a>、<button> 或 <input> 元素的样式:

Class Description Example
.btn Adds basic styling to any button 尝试一下
.btn-default Indicates a default/standard button 尝试一下
.btn-primary Provides extra visual weight and identifies the primary action in a set of buttons 尝试一下
.btn-success Indicates a successful or positive action 尝试一下
.btn-info Contextual button for informational alert messages 尝试一下
.btn-warning Indicates caution should be taken with this action 尝试一下
.btn-danger Indicates a dangerous or potentially negative action 尝试一下
.btn-link Makes a button look like a link (will still have button behavior) 尝试一下
.btn-lg Makes a large button 尝试一下
.btn-sm Makes a small button 尝试一下
.btn-xs Makes an extra small button 尝试一下
.btn-block Makes a block-level button (spans the full width of the parent element) 尝试一下
.active Makes the button appear pressed 尝试一下
.disabled Makes the button disabled 尝试一下
.navbar-btn Vertically aligns a button inside a navbar 尝试一下

按钮组类

下面的类可用于设置任何 <a>、<button> 或 <input> 元素的样式:

Class Description Example
.btn-group Groups buttons together on a single line 尝试一下
.btn-group-justified Makes a group of buttons span the entire width of the screen 尝试一下
.btn-group-lg Large button group (makes all buttons in a button group larger - increased font-size and padding) 尝试一下
.btn-group-sm Small button group (makes all buttons in a button group smaller) 尝试一下
.btn-group-xs Extra small button group (makes all buttons in a button group extra small) 尝试一下
.btn-group-vertical Makes a button group appear vertically stacked 尝试一下