aftab
aftab

Reputation: 693

How to add space between bootstrap buttons in same div?

I have two buttons inside same div i want to add space between these buttons. How can i achieve that without adding custom css. Is there any bootstrap solution for it ?

main.html

 <div class="btn-group pull-right">
    <button class="btn btn-default" type="button">View/Edit</button>
    <button class="btn btn-default" type="button">Edit Ratings</button>
 </div>

Upvotes: 0

Views: 12581

Answers (2)

Rob
Rob

Reputation: 187

I would highly recommend linking a css file and tampering with div margin isolated to the designated class.

IE)

<div class="Name1">
    <button class="Name2" type="button">View/Edit</button>
    <button class="Name3" type="button">Edit Ratings</button>
</div>

CSS:

.name2 button
{
  margin-left:5px;
}

Otherwise,

An HTML alternative would be...

&nbsp;

Upvotes: 1

Sean Mishra
Sean Mishra

Reputation: 309

This is a rudimentary solution using bootstrap only. You could play around with the col-md-* to achieve desired gap.

<div class="btn-group pull-right row">
  <div class="col-md-4"><button class="btn btn-default" type="button">View/Edit</button></div>
  <div class="col-md-1"></div>
  <div class="col-md-4"> <button class="btn btn-default" type="button">Edit Ratings</button></div>
 </div>

Upvotes: 2

Related Questions