0

Why is there whitespace between the buttons (code example below)? I tried removing all margins and paddings, yet the whitespace still stays there.

<body>
    <div class="button-container">
      <button>1</button>
      <button>2</button>
      <button>3</button>
      <button>4</button>
      <button>5</button>
    </div>
  </body>

1 Answers1

-2

Its because there is whitespace between them.

Consider

.button-container {
   overflow: auto;
}

.button-container button {
   border: 0;
   float: left;
}

https://css-tricks.com/fighting-the-space-between-inline-block-elements/

Shaun Forsyth
  • 454
  • 4
  • 7