给网页添加背景图片 html+css

标题:给网页添加背景图片 html+css

项目场景:

给网页添加背景图片,网页缩小放大都不受影响 html+css

问题描述:

给网页添加背景图片,网页缩小放大都不受影响 ,

解决方案:

1.在html写入一个div盒子

<div class="bjimg"></div>

2.写css代码

.bjimg {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      min-width: 1000px;
      z-index: -10;
      zoom: 1;
      background-color: #fff;
      background-image: url(../image/timg.jfif) ;
      background-repeat: no-repeat;
      background-size: cover;
      -webkit-background-size: cover;
      -o-background-size: cover;
      background-position: center 0;
    }

3.在url里写入自己图片地址就好

效果

我运行的效果
给字体添加背景图:
https://blog.csdn.net/luo1831251387/article/details/110774774

猜你喜欢

转载自blog.csdn.net/luo1831251387/article/details/110772006