Click to See Complete Forum and Search --> : stretchable image backgrounds?


DARTHTAMPON
01-07-2004, 02:02 AM
looking for a way to make an image stretch insted of tiling. I am using the image as a background of a <td> linked trough a style sheet. and as the cell expands i would like the background image to streth insted of tiling.

1. is this possible
2. how do i do it


thanks john

fredmv
01-07-2004, 02:04 AM
Welcome to the forums.

At this point in time, I don't believe that is possible. Maybe it will be in CSS3. We'll have to wait and see...

Robert Wellock
01-07-2004, 10:18 AM
Yes it is possible with DHTML or at least with a stretchable background image it is.

spufi
01-07-2004, 01:08 PM
Plus, images that get stretched can look less than impressive. Having a background image repeat isn't bad if when the image repeats it blends in a way that looks good.

fredmv
01-07-2004, 04:17 PM
Originally posted by Robert Wellock
Yes it is possible with DHTML or at least with a stretchable background image it is. Of course you could emulate it with JavaScript, however, I was referring to the use of pure CSS.

IncaWarrior
01-07-2004, 09:09 PM
there's no way that works well, but you could do an image in teh z-index (if it doesn't repeat) and set that to stretch

PeOfEo
01-07-2004, 09:24 PM
but z-index is not supported by older browsers and you would have an image taking up the first half of your site and throwing it all out of whack.

Robert Wellock
01-08-2004, 07:31 AM
Even applying the 'CSS Z-Index' would most likely fail because CSS-2 doesn't have the capacity to physically stretch images for a background-image - it has the ability to repeat though - with regards to being applied to the body, because the <body> is the canvas in question and inline images are considered 'replaced elements' thus would move the text position.

Out of interest: http://www.webreference.com/dhtml/diner/bgresize/

Aronya1
01-08-2004, 01:27 PM
What about attacking the problem from the other direction? Make the image extra large in the first place & force it to shrink to fit the table. Can that be done, or will the table just expand automatically to fit the image?

DARTHTAMPON
01-08-2004, 02:57 PM
extra large in the first place & force it to shrink to fit the table.

that would be great but then you have problems with picture size. But anyways thanks for the help guys, the link was useful. I decided to just go around the problem and fix the image to repeat without looking like its repeating. When i get some web space i will send you a link to it. Looks pretty neat.

thanks for all of your help
john