设置背景图片铺满整个屏幕

方案一

bgc {
    background-image: url(../image.ipg);
    positon:absolute;
    left:0;
    right:0;
    bottom:0;
    top:0;
}

方案二

    position absolute
    width 100vw
    height 100vh
    background-repeat no-repeat
    background-size cover
    background-position 50%
    background-image url('/static/img.jpg')

猜你喜欢

转载自www.cnblogs.com/liruijia/p/she-zhi-bei-jing-tu-pian-pu-man-zheng-ge-ping-mu.html
0条评论
添加一条新回复