意思是当盒子的大小大于一张背景图得大小时,剩余空白的地方要不套继续用这张图片去填充,repeat就是重复填充,no-repeat则只使用一次图片
在CSS中,background-repeat 属性设置是否及如何重复背景图像。
示例代码:
示例 inherit
1、background-repeat:repeat 是默认属性,使背景图像在水平和垂直方向上重复。
2、background-repeat:repeat-x 背景图像将在水平方向重复。
3、background-repeat:repeat-y 背景图像将在垂直方向重复。
4、background-repeat:no-repeat 背景图像将仅显示一次。
5、background-repeat:inherit 规定应该从父元素继承 background-repeat 属性的设置。
repeat就是重复的意思,背景默认就是整个页面重复的你又设置它为重复的当然没用!
background-repeat: 后面的属性可以是
repeat 背景图像在纵向和横向上平铺
no-repeat 背景图像不平铺
repeat-x 背景图像在横向上平铺
repeat-y 背景图像在纵向平铺
背景图片将会在水平和垂直两个方向都重复,这个是background-repeat属性的默认值。
repeat是重复的意思
background-repeat:repeat
是让背景图片重复平铺
而在css中背景图片默认就是repeat
重复的
所以你加了
background-repeat:repeat
和没加是一样的