PDA

View Full Version : Can you get an image to repeat without making it the background to a container?



kryptobs2000
11 Mar 2010, 04:42 PM
I'm trying to build a container code snippet so that I can reuse it on later project. So far I have it so there is a top of fixed width, also with a bottom. Then I have the sides which I would like to grow to whatever length is required to match the text, as well as the background.

Getting the top placed is easy, now I'm trying to get the left side placed and I'm running into trouble. How do I get the side to stretch down to fill the container? After I get the sides I figured I'd just have a separate <div> for the text to which I would apply the gradient background, that seems easy enough. Then more headaches can follow from that point.

Wickham
12 Mar 2010, 12:54 AM
Then I have the sides which I would like to grow to whatever length is required to match the text, as well as the background.


There are several methods to drag down the side borders/images to the same height as a middle content div, See items 17 and 18 here:-
http://www.wickham43.net/firefoxbackground.php

In some examples the two side divs are wide, but could be narrow with just a border image or color.

Also items 12 and 13 here:-
http://www.wickham43.net/specialeffects.php
(Item 13b uses the same nesting code as item 17a on the previous link).
You need to be careful calculating the widths of the divs.