View Full Version : Repeating Content BG Image
I have an image *(see attachment) that I want to repeat on the Y axis according to the amount of text that is in it.
How can I do that with this image?
Thanks in advance!
LMW1
djr33
04-27-2010, 04:49 AM
Set the image as the background on repeat (limit to only repeat in the y direction if you want, but that won't matter).
Now, simply resize the div based on the amount of text. Y means "up and down", right? So just use a normal div with that as the background and that should be everything you need to do.
For something more complex like X repeating that would mean a little more CSS, but it's certainly possible.
If you want, remember also to set a width for the div so that it doesn't get too wide and repeat the image on the X axis.
XHTMLiT
04-27-2010, 05:05 AM
Hi,
Just to elaborate on the above statement "djr33" said. You would be looking at something like this;
CSS File:
div#container {width:auto;background:url(the/path/to/your/image) repeat-x;overflow:hidden;}
XHTML File:
<div id="container"></div>
Now within the same line of CSS for the div#container, you can use top or bottom, depending if you will be assigning height to that div. In case there is more text in the div then background and it expands down ward, you would use either top which would make the background repeat-x but at the very top of the div or use bottom for the same result but on the very bottom of the div.
Hope that helps.
Awesome! I'll give it a whirl and see what I whip up.
Thanks for taking your time to answer my question. I really do appreciate it.
Respectfully,
Len
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.