如何防止网页的背景图片重复 no-repeat
2017-04-21 07:55
323 查看
(1)现在一般都用css设定了,比如在一个div下设背景图片切不让其重复,则可设一个样式,比如:
.nobgrepeat{background:url(背景图片地址) left top no-repeat;}
(2)也可以设置背景图片的高宽,要与背景图片的大小一样
注意:但是有时候加了 no-repeate之后,图片就会不见了,这种情况与设置的 left top 位置有关
[align=left].xcConfirm .popBox .ttBox {[/align]
width:550px ;
height:
100px ;
line-height : 60px;
padding: 14px
30px;
background: url(../images/yezi.png)
35px
20px
no-repeat;
[align=left] [/align]
[align=left] }[/align]
[align=left]
[/align]
[align=left]如果height太小,背景图片后面设置的top太大的话,就会被隐藏在后面,就会看不见[/align]
[align=left]
[/align]
[align=left]
[/align]
语法:
background-repeat : repeat | no-repeat | repeat-x | repeat-y
参数:
repeat : 背景图像在纵向和横向上平铺
no-repeat : 背景图像不平铺
repeat-x : 背景图像在横向上平铺
repeat-y : 背景图像在纵向平铺
说明:
设置或检索对象的背景图像是否及如何铺排。必须先指定对象的背景图像。
对应的脚本特性为backgroundRepeat。请参阅我编写的其他书目。
示例:
menu { background: url("images/aardvark.gif"); background-repeat: repeat-y; }
p { background: url("images/aardvark.gif"); background-repeat: no-repeat; }
.nobgrepeat{background:url(背景图片地址) left top no-repeat;}
(2)也可以设置背景图片的高宽,要与背景图片的大小一样
注意:但是有时候加了 no-repeate之后,图片就会不见了,这种情况与设置的 left top 位置有关
[align=left].xcConfirm .popBox .ttBox {[/align]
width:550px ;
height:
100px ;
line-height : 60px;
padding: 14px
30px;
background: url(../images/yezi.png)
35px
20px
no-repeat;
[align=left] [/align]
[align=left] }[/align]
[align=left]
[/align]
[align=left]如果height太小,背景图片后面设置的top太大的话,就会被隐藏在后面,就会看不见[/align]
[align=left]
[/align]
[align=left]
[/align]
语法:
background-repeat : repeat | no-repeat | repeat-x | repeat-y
参数:
repeat : 背景图像在纵向和横向上平铺
no-repeat : 背景图像不平铺
repeat-x : 背景图像在横向上平铺
repeat-y : 背景图像在纵向平铺
说明:
设置或检索对象的背景图像是否及如何铺排。必须先指定对象的背景图像。
对应的脚本特性为backgroundRepeat。请参阅我编写的其他书目。
示例:
menu { background: url("images/aardvark.gif"); background-repeat: repeat-y; }
p { background: url("images/aardvark.gif"); background-repeat: no-repeat; }
相关文章推荐
- 一个在IE6下no-repeat依然重复背景图片的BUG
- 网页如何防止刷新重复提交与如何防止后退的解决方法
- 网页如何防止刷新重复提交与如何防止后退的解决方法
- 背景图片在ie7上显示不出来 在火狐上可以显示 找了半天也没有找到原因 后来发现 no-repeat与url之间没有空开 加了空格后ie7上能显示了
- 网页开发之如何防止表单重复提交
- css 如何让背景图片拉伸填充避免重复显示
- ASP.NET 网页设计如何设置全局背景图片
- 所有网页背景图放入一张图片,如何调用
- 如何防止一个url对应的图片重复下载两次
- 网页如何防止刷新重复提交与如何防止后退的解决方法
- 如何让背景图片不重复填充在div中
- 防止网页中的背景图片被另存为
- 网页如何防止刷新重复提交与如何防止后退的解决方法
- css 背景图片宽度100% 高度延y轴重复repeat-y方法
- 设置网页背景图片平铺方式 background-repeat 属性
- css 如何让背景图片拉伸填充避免重复显示
- css 如何让背景图片拉伸填充避免重复显示
- css中设置网页背景图片平铺但不重复
- HTML&CSS——background: url() no-repeat 0 -64px;CSS中背景图片定位方法
- css 背景图片宽度100% 高度延y轴重复repeat-y方法