Make DIV cover 100% of viewport instead of 100% of Body

前端 未结 4 1845
死守一世寂寞
死守一世寂寞 2021-02-14 10:14

My post is in regards to http://www.thepostboard.net

I need to make the black box that is currently covering 100% of the viewport cover the entire page instead. You\'ll

4条回答
  •  悲&欢浪女
    2021-02-14 10:59

    This solution has worked best for me:

    #overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    

    No need to style any other elements except the tag.

提交回复
热议问题