CSS中怎么让图片平铺?要让图片平铺,我们需要使用CSS中的backgroundrepeat属性。这个属性用来控制背景图片的重复方式,常见的值有:norepeat、repeatx、repeaty、和r...
CSS中怎么让图片平铺?
要让图片平铺,我们需要使用CSS中的background-repeat属性。这个属性用来控制背景图片的重复方式,常见的值有:no-repeat、repeat-x、repeat-y、和repeat。
1. no-repeat
no-repeat表示不重复。这个值会使得背景图片只在背景中出现一次,而不是重复出现。
例如:
css
background-repeat: no-repeat; css
background-repeat: repeat-x; css
background-repeat: repeat-y; css
background-repeat: repeat;