Mikk Poles Mikk Poles - 1 year ago 79
HTML Question

Simple CSS issue - Blank space above

I am working on a coming soon page here: http://desertcinema.com/jheck/

However I run into some issue with regards an extra space at the top of my

<div class="background-filter"></div>

enter image description here

Basically I have this CSS for this part:

.background-filter {
background: #000;
opacity: 0.5;
margin: 0;
-webkit-background-size: cover;
-moz-background-size: cover;
-ms-background-size: cover;
-o-background-size: cover;
background-size: cover;

I am wondering what is the reason why I have space at the top. This div must cover up the whole thing of the space with no spaces.

Any idea what's causing this and how to fix it? You can use CHROME INSPECT ELEMENT for the play.

Answer Source

Just add style top: 0; to .background-filter.

The position of an element does not default to 0,0. It's position is set by default relative to the containing element.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download