移动端填充满屏展示

1、使用js获取屏幕高度,手动填充剩余的部分区域

2、使用伪元素,整屏设置背景色填充

<html>
    <head></head>
    <body>
        <div class="page-container">
            我是内容
        </div>
    </body>
</html>


.page-container::beforer{
    content:" ";
    position:absolute;
    left:0;
    right:0;
    top:0;
    bottom:0;
    background-color:#ccc;/* 颜色自定义 */
    z-index:-100;/* 突然想到个游戏,是男人就下100层。。。 */
}

参考:https://www.jianshu.com/p/838076f611ab

posted @ 2019-09-20 17:05  极客小乌龟  阅读(411)  评论(0编辑  收藏  举报