Forum Moderators: open

Message Too Old, No Replies

Cell backgound images

Cell background images

         

sbaker76

12:50 am on Aug 26, 2003 (gmt 0)



Hi,

I've got a gradient colour image i want to spread across the table.

How can i make the image stretch accross the 100% cell without tiling.

Probably a stupid question, but if anyone could help it would be great

Thanks :)

sarah

tedster

1:09 am on Aug 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi sbaker, and welcome to WebmasterWorld.

Cell backgrounds will tile by default if there is more space in the table cell than the size of the background image. You can use css to stop the tiling, and then you have blank background from that point on in the cell.

The css rule to stop all tiling is background-repeat:no-repeat;

Does the gradient shift colors from left to right, or from top to bottom? If it's only one of these, either the x-axis or the y-axis, then you can tile the image indefinitely as long as one dimension of your background image is at least as wide as the table cell.

However, if the gradient does not shift exclusively along one of these axes, then you can only make a great big image (bigger than the cell will ever be in both dimensions).

And finally, I've made tiling gradients that work indefinitely, but the gradient needs to return to its starting color so that no seams show. I do this by doubling the height or width (whichever is reauired) and then pasting in a copy of the gradient and flipping it into to empty space.