0

Why does the html page adds a space every time I make a new line of code in the file?

When I make all of the html tags in the same line of code the spaces disappear.

* {
    box-sizing: border-box;
}

#A {
    background-color: red;
    max-width: 60px;
    min-width: 60px;
    border-right: solid 2px gray;
    display: inline-block;
}
<!DOCTYPE html>
  <html>
    <body>
      <span id="A">A</span>
      <span id="A">A</span>
      <span id="A">A</span>
      <span id="A">A</span>
      <span id="A">A</span>
    </body>
  </html>
Martin
  • 22,212
  • 11
  • 70
  • 132
Elo
  • 23
  • 5
  • This is an inherited styling feature and/or due to `inline-block` display setting; whereby the whitespace is shown. – Martin Jul 03 '20 at 15:37
  • You may want to read [Fighting the Space Between Inline Block Elements](https://css-tricks.com/fighting-the-space-between-inline-block-elements/) for more info. – yinsweet Jul 03 '20 at 15:39

0 Answers0