Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change shape of Bootstrap button

How can I change the round corner button default in bootstrap into normal rectangle button? Now I can only change the size color or the font of the button

.btn-lg {
  padding: 10px 16px;
  font-size: 18px;
  line-height: 1.33;
  border-radius: 6px;
}

.btn-sm,
.btn-xs {
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
}

Appreciate your help

like image 226
Gavin Niu Avatar asked Oct 06 '15 16:10

Gavin Niu


People also ask

How do you shape a button?

Right-click the shape and select Convert to Button. The shape object is replaced by the button object and the Button property ribbons (Properties, Style, and Position & Size) along with the Action ribbon are made available.

How do I change the outline button in Bootstrap?

You'll simply use the class . btn btn-outline in your HTML instead of . btn and the CSS style property border-color instead of background-color.


2 Answers

Add the class rounded-0, as explained on GetBootstrap.com:

<a href="tel:+447447218297" class="btn btn-lg btn-success rounded-0"><img src="">Call Now</a>
like image 185
Saif Islam Avatar answered Sep 26 '22 23:09

Saif Islam


The best practice is to create a custom class so you don't change your base CSS in the event you want to use it elsewhere, then apply your changes.

In the example I use .btn.btn-custom-lg, .btn.btn-custom-sm, .btn.btn-custom-xs but if you only want to change something like the border-radius for all buttons you can make one global class to apply to the button: .btn-square { border-radius: 0; }

See working example.

/*Specific Cases*/

.btn.btn-custom-lg,
.btn.btn-custom-sm,
.btn.btn-custom-xs {
  border-radius: 0;
}
/*Global*/

.btn.btn-square {
  border-radius: 0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">

  <hr>
  <h3>Specific</h3>
  <div class="btn btn-default btn-lg btn-custom-lg">Button Default</div>
  <div class="btn btn-default btn-sm btn-custom-sm">Button Default</div>
  <div class="btn btn-default btn-xs btn-custom-xs">Button Default</div>
  <hr>
  <h3>Global</h3>
  <div class="btn btn-default btn-lg btn-square">Button Default</div>
  <div class="btn btn-default btn-sm btn-square">Button Default</div>
  <div class="btn btn-default btn-xs btn-square">Button Default</div>
</div>
like image 38
vanburen Avatar answered Sep 26 '22 23:09

vanburen