When you set an image to be a background, and the table’s size exceeds the size of the image, it “tiles” the image. Is their a way for it to stretch the image instead?
BTW, I’m using Dreamweaver MX 2004.
Thanks in advance
This is what you want:
Um, it doesn’t say how to stretch the image in the background…
Good info, though.
I don’t think you can stretch am image with HTML or CSS, but I have seen things done this way.
Take your picture, say it is 100X100 pixles. Then cut off the far right pixle and make another image that would be 1 pixle wide by 100 picles high. Make the 1X100 pixle image the background of your table. Then add the regular picture as just an image
http://www.atsurreal.com/stretch.htm
<table cellspacing="0" cellpadding="0" bgcolor="#cccccc" border="0"
width="100%" height="300" background="images/stretch.jpg">
<tr><td valign="left"><img src="images/bimmer.jpg"></td></tr></table>
Should the 1X100 be transparent?
Also, what if I wanted it to stretch vertically, would I take the bottommost pixel and make a 100X1 image?
Thanks.
Look at this so you can visualize it http://www.atsurreal.com/stretch.htm
The blurry part on the left is the 1 pixle image repeating. You do not want to make it transparent.
If you want to make it repeat on the bottom, yes you need to cut the one pixle out of the bottom and have 100X1. Then just change the alignment type to valign=“top”. This will make the big picture stay at the top, and the 1 pixle image show up on the bottom.
Hey, I just thought of something else…
<img src=“image.gif” width=“100%” height=“100%”>
I tried it in IE and it worked, not sure of others. It will probably distort the pic if it is stretched too much.
Thanks, figured it out!