Bootstrap CSS space between buttons in navbar

前端 未结 3 509
一整个雨季
一整个雨季 2021-01-12 10:25

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://j

相关标签:
3条回答
  • 2021-01-12 11:03

    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>
    
    0 讨论(0)
  • 2021-01-12 11:10

    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>
    
    0 讨论(0)
  • 2021-01-12 11:17

    you may try margin-left

    here is the code

    .btn{
    margin-left:10px;
    }
    

    here is the example:: FIDDLE

    0 讨论(0)
提交回复
热议问题