1.如何控制背景图片的平铺方式?
在CSS中有一个background-repeat属性,就是专门用于控制背景图片的平铺方式的
取值:
repeat 默认,在水平和垂直都需要平铺
no-repeat 在水平和垂直都不需要平铺
repeat-x 只在水平方向平铺
repeat-y 只在垂直方向平铺
应用场景:
先看原理图片
可以通过背景图片的平铺来降低图片的大小,提升网页的访问速度