user2989236 user2989236 - 20 days ago 3
CSS Question

How to remove white space around header image?

I am experimenting with my header but I can't remove the white space around it, this is what my code looks like:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>

<head>
<style type="text/css">
.header{background:url(http://likenation.com/theme/pes/images/header_bar.png) repeat-x;border-bottom:1px solid #131619;height:56px}
.header-content{width:1000px;margin:auto}
</style>
</head>
<body>
<div class="header">
<div class="header-content">
Test
</div>
</div>
</body>
</html>


And this is what the header looks like: http://gyazo.com/b71ad68c24c2bdb49619a44c551918c5.png

I would really appreciate if someone could help me fix this.

EDIT:

Since I can't answer my own question, I will post it here:

I added this:

html,body {
margin:0;
padding:0;
}


and it worked, thanks for the help guys!

Answer

Add this to your CSS:

html, body {
  margin: 0; 
  padding: 0;
}
Comments