css - cover div adding a margin -


i have #cover div following css

#cover {     background-color: #ffffff;     height: 100%;     opacity: 0.4;     position: fixed;     width: 100%;     z-index: 9000; } 

i want cover entire (viewed) page so

enter image description here

however when scroll down see this

enter image description here

thats because margin of 8 added top , left.

i tried adding margin:-8 -8 8 8; no success. why??? , how can fix this?

demo fiddle.

you fogot set position. add:

top: 0; left: 0; 

since havn't posted complete markup, can assume body has margin or padding causing shift you're seeing.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -