2

Using a simple code, there's a kind of a "border" around the header background. How can I remove this?

header {
  height: 400px;
  background: red;
 }
<header></header>

3
  • what kind of border? you mean white-space around the page? Commented Nov 22, 2014 at 20:14
  • Yup, the awnser of @emmanuel solved it :) Commented Nov 22, 2014 at 20:18
  • use Normalize.css to makes the browsers render all elements more consistently and in line with modern standards. Commented Nov 22, 2014 at 20:59

2 Answers 2

2

You have to reset default <body> margin / padding.

body {
  margin: 0;
  padding: 0;
}
header {
  height: 400px;
  background: red;
}
<header></header>

Sign up to request clarification or add additional context in comments.

2 Comments

That's true but it is a common reset method.
Oh, thats all haha! Thanks :D
0

It's just the default margin on body. It's generally a good idea to reset the margin and padding to 0 for all elements.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.