Bulma: No margin between buttons

Created on 18 Oct 2016  路  5Comments  路  Source: jgthms/bulma

Checklist

  • [X] This is about the Bulma CSS framework
  • [ ] This is about the Bulma Docs
  • [X] I'm using Bulma version [x.x.x]
  • [X] My browser is: Chrome 53
  • [X] I am sure this issue is not a duplicate?

    Description

Buttons rely on newlines for gap. Compressing the HTML removes all space between buttons.

Steps to Reproduce

<div class="column">
  <a class="button is-outlined">Outlined</a>
  <a class="button is-primary is-outlined">Outlined</a>
  <a class="button is-info is-outlined">Outlined</a>
  <a class="button is-success is-outlined">Outlined</a>
  <a class="button is-danger is-outlined">Outlined</a>
</div>

Produces this:

screen shot 2016-10-18 at 13 19 32

Remove the newlines:

<div class="column"><a class="button is-outlined">Outlined</a><a class="button is-primary is-outlined">Outlined</a><a class="button is-info is-outlined">Outlined</a><a class="button is-success is-outlined">Outlined</a><a class="button is-danger is-outlined">Outlined</a></div>

image

Expected behavior

There should be some margin between buttons.

Actual behavior

No margin

bulma needs help

Most helpful comment

2019

Need to wrap the buttons inside a div with a class buttons

<div class="buttons">
    <button class="button">Button 1</button>
    <button class="button">Button 2</button>
</div>

All 5 comments

Yes it's the normal behaviour, as buttons are inline-flex or inline-block. This allows to specify an exact margin.

If you want regular spacing, you can use a button group.

Thanks, I can see that is-grouped is the correct usage now.

Is there any possibility of having it so that buttons margins' aren't mutated based on newlines to prevent idiots like me question the behaviour of button margins.

That's unfortunately the default behaviour of browsers.

Thanks, I can see why this must be like this now. Great project BTW! Really enjoying using it.

2019

Need to wrap the buttons inside a div with a class buttons

<div class="buttons">
    <button class="button">Button 1</button>
    <button class="button">Button 2</button>
</div>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaredreich picture jaredreich  路  3Comments

scottgrayson picture scottgrayson  路  3Comments

Cosbgn picture Cosbgn  路  3Comments

Yard8 picture Yard8  路  3Comments

leofontes picture leofontes  路  3Comments