简体   繁体   中英

How to make a background image repeat horizontally?

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

I want to make an image repeat in a horizontal direction, I thought I could to this by making it a background image but it isn't working. tell me what I am doing wrong thanks.

Try this out:

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

You can make it repeat horizontally with a background, but the background needs to be on the container, not the img itself. Do something like this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM