Grey-lover
Grey-lover

Reputation: 633

Why is there margin before the image?

I have not put any margin on top of the logo image but still there is gap. I don't understand why. The page is live at http://goo.gl/jNbFp9

My markup:

<header>
<img src="images/home-layout_04.jpg" alt="">
</header>

My CSS:

body {
background-color: #d2d1d0;
background-image: url(images/home-layout_02.jpg);
background-repeat: repeat-x;
background-position: center top;
}
header { width: 984px; margin: 0 auto; text-align: left;}
header img { float: left; margin: 0; padding: 0;}

Upvotes: 0

Views: 50

Answers (5)

Overlugged
Overlugged

Reputation: 39

You can use any one of these,

http://www.cssreset.com/

it will help you have the same rendering in all browsers and avoid this kind of problems

Upvotes: 0

Phani
Phani

Reputation: 861

you have margin:8px; on your body style

add this in your body css styling

margin:0px !important;

Upvotes: 0

SKeurentjes
SKeurentjes

Reputation: 1878

Your body has a margin: 8px;. U could use a reset.css

Upvotes: 0

Daniele94
Daniele94

Reputation: 98

try this in in body:

margin-top:0px;

Upvotes: 0

Add margin: 0px; to the body

this was the missing part, i tried it on Google chrome inspect element and it worked.

Upvotes: 1

Related Questions