Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Want to get rid of border on header

So I want to get rid of this white space/border between the top of the webpage and the header, so as to make it look more aesthetically pleasing. Does anyone have any tips?

#mainstyle {
  background-color: blue;
  color: white;
  text-align: center;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}

.header {
  padding: 90px;
  margin: 0px;
  background-color: black;
  text-align: center;
  color: white;
  font-size: 30px;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
<div class="header">
  <h1>Header</h1>
  <p>My supercool header</p>
</div>

[1] – https://i.stack.imgur.com/Lmd06.png – picture of website

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You want to add margin: 0 to your body element.

#mainstyle {
  background-color: blue;
  color: white;
  text-align: center;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}

body {
  margin: 0;
}

.header {
  padding: 90px;
  margin: 0px;
  background-color: black;
  text-align: center;
  color: white;
  font-size: 30px;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
<div class="header">
  <h1>Header</h1>
  <p>My supercool header</p>
</div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading