网页设计HTML中如何插入背景图片呢?今天一起来看一下吧 。
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/1019102355-0.png)
方法
打开HBuilderX软件【网页设计HTML中如何插入背景图片】
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/1019103333-1.png)
进入后新建一个html文件
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/1019104Y1-2.png)
命名为背景图片点击创建
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/1019101419-3.png)
然后在同一文件夹中放入一张背景图片
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/1019103T8-4.png)
然后在head中编写style样式,如图所示 。
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/1019102618-5.png)
按ctrl+s保存然后点击上方视频图标选择浏览器进行运行即可
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/101910F30-6.png)
效果如图所示,未设置平铺方式的情况为默认水平竖直平铺
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/101910C63-7.png)
不想重复平铺在后方加入代码:background-repeat: no-repeat这样图片只会显示一次
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/1019103X1-8.png)
效果如图所示
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/1019106337-9.png)
想要水平重复平铺,在后放输入代码background-repeat: r造酸喜表epeat-x
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/1019102120-10.png)
效果如图所示
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/10191062a-11.png)
竖直重复平铺添加代码:background-repeat: repeat-y
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/1019104G2-12.png)
元备做期协候盐奏效果如图所示
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/1019103646-13.png)
水平竖直都重复平铺也就是默认样式代码为:background-repeat: repeat
![网页设计HTML中如何插入背景图片](http://imgit.jingyanla.com/240313/101910I34-14.png)