-2

Consider the following HTML

<div class="buttons">
    <button>Left</button>
    <button>Middle</button>
    <button>Right</button>
</div>

I can see spacing between buttons, which I understand is due to the CR/LF between each button markup.

Is there a way to correct this with CSS?

enter image description here

Matthew Layton
  • 35,375
  • 44
  • 163
  • 278

1 Answers1

2

Yes, there are 2 ways:

First Way:

Set the html markup side by side

<div class="buttons">
    <button>Left</button><button>Middle</button><button>Right</button>
</div>

Second Way

Set float:left in the buttons

button{
float:left;
display: inline-block;
}
Luís P. A.
  • 9,119
  • 2
  • 22
  • 34