How to make space between two buttons in same div with CSS?

Spread the love

Sometimes, we want to make space between two buttons in same div with CSS.

In this article, we’ll look at how to make space between two buttons in same div with CSS.

How to make space between two buttons in same div with CSS?

To make space between two buttons in same div with CSS, we set the margins on the buttons.

For instance, we write

<div class="btn-toolbar pull-right">
  <button type="button" class="btn mr-3">btn1</button>
  <button type="button" class="btn mr-3">btn2</button>
  <button type="button" class="btn">btn3</button>
</div>

to add buttons into a div.

Then we write

button {
  margin: 13px;
}

to add 13px margin on all 4 sides on each button.

Conclusion

To make space between two buttons in same div with CSS, we set the margins on the buttons.

Leave a Reply

Your email address will not be published.