Julian Camilleri
Julian Camilleri

Reputation: 3095

Position relative container white space

Position Relative Container

[CSS]

#banner-container {
    display: block;

    margin-bottom: -55px;
    left: 0px;

    width: 100%;
    height: 55px;

    margin: 0 auto;
    z-index: 200;

    background: rgba(255,255,255,0.75);
    background-repeat: repeat-x;

    overflow: hidden;
    position: relative;
}

I went through all I found on here for white space, and how to remove white space from position relative containers, but I can't seem to get it. - Can someone help me get this right and explain to me why this happens?

Thanks :)

Upvotes: 0

Views: 202

Answers (5)

J.K
J.K

Reputation: 16

Try

*{margin:0;padding:0;} else body{margin:0;padding:0;} else try same think in your div.

Upvotes: 0

shakhrillo
shakhrillo

Reputation: 37

just enter

 body {
    margin:0;
    top:0;
    }

Upvotes: 1

Dinǝsh Gupta
Dinǝsh Gupta

Reputation: 387

By default all the elements in HTML has its own style, so does relatively placed div. IF you are using div then apply this to your css

div{margin:0px; padding:0px;}

or

*{margin:0px; padding:0px;}

this will be applied to all the elements in html

Upvotes: 2

Julian Camilleri
Julian Camilleri

Reputation: 3095

Fix:

body {
 margin: 0px;
 padding: 0px;
}

Upvotes: 1

browser have there own css styler.. u have to use

*
{
margin:0;
padding:0;
} 

or reset.css to reset the stylesheet rendered by browsers

http://meyerweb.com/eric/tools/css/reset/reset.css

Upvotes: 1

Related Questions