html怎么设置背景图片平铺方
发布时间:-06-03 17:39:50
来源:亿速云
阅读:83
作者:Leah
这篇文章给大家介绍html怎么设置背景图片平铺方,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。
html背景图片设置平铺方式html>
div{
border:1pxsolid#000fff;
height:200px;
background-image:url(img/1.jpg);
margin-bottom:10px;
}
#content1{
background-repeat:repeat;
}
#content2{
background-repeat:repeat-x;
}
#content3{
background-repeat:repeat-y;
}
#content4{
background-repeat:no-repeat;
}
效果图:
说明:
background-repeat 属性设置是否及如何重复背景图像,定义了图像的平铺模式。
默认地,背景图像在水平和垂直方向上重复。
属性值:值描述
repeat默认。背景图像将在垂直方向和水平方向重复。
repeat-x背景图像将在水平方向重复。
repeat-y背景图像将在垂直方向重复。
no-repeat背景图像将仅显示一次。
关于html怎么设置背景图片平铺方就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。