1

border-top cut off by the top of page??

I have tried setting the margin-top of the h2 element but it was still the same result.

body {
  font-family: 'Open Sans', sans-serif;
  height: auto;
  margin: 0;
  background: #222;
}

#heading-background {
  background: #55d6aa;
  height: 50px;
  color: rgba(255, 255, 255, 1);
}

h2 {
  color: #222;
  padding: 0 0 0 14px;
  margin: 10px 0 0 20px;
  font-size: 28px;
  letter-spacing: 0.5em;
  display: inline;
  border: 2px solid #222;
  border-radius: 8px;
}
<div id="heading">
  <div id="heading-background">
    <div id="heading-text">
      <h2>TODO</h2>
    </div>
  </div>
</div>
Temani Afif
  • 245,468
  • 26
  • 309
  • 415
Kroavex
  • 11
  • 1

1 Answers1

2

This will do the work h2 { display: inline-block; }

Joykal Infotech
  • 1,840
  • 3
  • 9
  • 17