Home  >  Article  >  Web Front-end  >  What are the styles of bootstrapt buttons?

What are the styles of bootstrapt buttons?

(*-*)浩
(*-*)浩Original
2019-07-12 10:49:263738browse

What are the styles of bootstrapt buttons?

Abstract: Bootstrap button styles mainly include: basic button, default button, main button, success button, information button, warning button, danger button , link button.

1. Introduction to buttons:

Buttons are also one of the core contents of the Bootstrap framework. Because buttons are an indispensable thing in Web production.

Moreover, different Web pages have different button styles, and even the same Web website or application has multiple button styles, such as different button colors, sizes, and states.


<button class="btn" type="button">基础按钮.btn</button>  
   <button class="btn btn-default" type="button">默认按钮.btn-default</button> 
   <button class="btn btn-primary" type="button">主要按钮.btn-primary</button> 
   <button class="btn btn-success" type="button">成功按钮.btn-success</button> 
   <button class="btn btn-info" type="button">信息按钮.btn-info</button> 
   <button class="btn btn-warning" type="button">警告按钮.btn-warning</button> 
   <button class="btn btn-danger" type="button">危险按钮.btn-danger</button> 
   <button class="btn btn-link" type="button">链接按钮.btn-link</button>

 

2. Basic buttons

Bootstrap Framework V3 The basic buttons of the .x version are the same as the basic buttons of the V2.x version, and are implemented through the class name "btn".

The difference is that the V3.x version is much simpler, and a large number of special effects in CSS3 in the V2.x version have been removed, such as text-shadow and gradient background ), border shadow (box-shadow), etc.
The Bootstrap framework takes into account the parsing differences of different browsers and performs relatively safe compatibility processing so that the button effects are basically the same in different browsers.

For the source code, please refer to lines 1992 to 2010 of the bootstrap.css file:

The buttons of the Bootstrap framework are very simple to use. The usage method is as follows:


<button class="btn" type="button">我是一个基本按钮</button>

 

3. Default button

The Bootstrap framework first passes the base class name ".btn" defines a basic button style, and then ".btn-default" defines a default button style.

The default button style is based on the basic button style, with the background color, border color and text color modified.

For the source code, please refer to lines 2040 to 2044 of the bootstrap.css file

Using the default button style is also very simple, just add the basic button "btn" Basically, just add the class name "btn-default":


<button class="btn btn-default" type="button">默认按钮</button>

 

4. Multi-label support (multiple label production buttons)

General production In addition to using the