Henrik
Henrik

Reputation: 1807

Gap before header starts

There is some whitespace to the left of the header. How can i get rid of this?

.h {
    background: url('../Content/images/headlogo.png') no-repeat center;
    display: block;
    height: 93px;
    background-color: #D60024;
}

I want it to stretch from the beginning to the end.

JSFiddle

Upvotes: 0

Views: 58

Answers (4)

G.L.P
G.L.P

Reputation: 7217

The easiest way to reset styles is to set the margin and padding on all elements to zero

CSS Reset looks like this:

*{    
margin:0;
padding:0;

}

JSFiddle URL

Upvotes: 0

Ravi Patel
Ravi Patel

Reputation: 5211

Demo

 body{
     margin: 0;
     padding: 0;
 }
.h {
    display: block;
    height: 93px;
    background-color: #D60024;
   }

enter image description here

Upvotes: 0

Karim AG
Karim AG

Reputation: 2193

This is either the margin or the padding for the body or the whole html document, either set html, body {maring:0; padding:0} or use a css reset like Eric Meyer's.

Upvotes: 0

Jacob
Jacob

Reputation: 2071

Add this too your CSS:

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

Upvotes: 3

Related Questions