7

How can I make space between buttons in navbar? I usually do that with  but it doesn't work now. Here's an JSfiddle of how it looks:

http://jsfiddle.net/W6hEa/

Adrift
  • 58,167
  • 12
  • 92
  • 90
dynamitem
  • 1,647
  • 6
  • 25
  • 45
  • http://jsfiddle.net/W6hEa/1/ works for me, but is probably not what you want – tobspr Aug 05 '13 at 18:25
  • 2
    Personally I think the navbar links look nicer than putting buttons in there, and you can still use the icons if you wish. Otherwise I agree with the margin-left or right. http://jsfiddle.net/W6hEa/3/ – Steve Valliere Aug 05 '13 at 18:39

3 Answers3

12

you may try margin-left

here is the code

.btn{
margin-left:10px;
}

here is the example:: FIDDLE

RbG
  • 3,181
  • 3
  • 32
  • 43
8

Copy & paste this to your style.css and assign it as class attribute:

.btn-margin-left {
    margin-left: 2px;
}
.btn-margin-right {
    margin-right: 2px;
}

Usage

<a href="URL" class="btn btn-default btn-sm btn-margin-left">Link</a>

<button type="button" class="btn btn-default btn-sm btn-margin-left">Button</button>
Jens A. Koch
  • 39,862
  • 13
  • 113
  • 141
1

You can define spacing inside the class in bootstrap 4.0x.

https://getbootstrap.com/docs/4.0/utilities/spacing/

So for example

<button type="button" class="btn btn-default ml-2>Button</button>
Crabigator360
  • 822
  • 10
  • 9