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

前端 未结 4 2027
无人及你
无人及你 2021-02-14 10:22

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:38

    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.

提交回复
热议问题