如何使背景图像水平重复?

时间:2013-05-08 06:12:52

标签: html web wysiwyg

<div id="background"> <img src="images/Untitled.gif" id="Image5" alt="" style="background-repeat:repeat-y;width:273px;height:68px;"/> </div>

我想让图像在水平方向上重复,我想我可以通过将其作为背景图像来实现,但它不起作用。告诉我,我做错了什么,谢谢。

2 个答案:

答案 0 :(得分:3)

试试这个:

<div style="height: 100px; background-image:url('picture.jpg'); background-repeat:repeat-x;">
Your text here.
</div>

答案 1 :(得分:0)

您可以使用背景水平重复,但背景需要在容器上,而不是img本身。做这样的事情:

<div style="height: 68px; background: url(image.png);"></div>