cover div adding a margin

前端 未结 2 562
失恋的感觉
失恋的感觉 2021-01-24 14:02

i have a #cover div with the following css

#cover {
    background-color: #FFFFFF;
    height: 100%;
    opacity: 0.4;
    position: fi         


        
2条回答
  •  梦谈多话
    2021-01-24 14:20

    you fogot to set a position. just add:

    top: 0;
    left: 0;
    

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

    • fiddle demonstratig the problem
    • fiddle with fix applied

提交回复
热议问题