Link to home
Start Free TrialLog in
Avatar of elsamman
elsamman

asked on

Background images that stretch rather than tile

Is there any way to have a background image for a TD, TABLE, DIV or SPAN stretch to fill the current size of the object rather than tile?
Avatar of dynamics407
dynamics407

usually all that has to be done is upload the image, taking note of the images dimension ( h x w ) then define the table cell to fit that.

ie. assume that the image is 300 x 250.


<TABLE width="100%" height="100%">
  <TR>
  <TD width="250" height="300" background="image">
  Some text.
  </TD>
  </TR>
</TABLE>
I assume you mean that the image is smaller than the td/table/div/span and instead of having a tiled background image, you want a stretched background image?
Avatar of elsamman

ASKER

Correct.  It is a simple case of a table for a graphical button using text instead of graphics.  The buton is a table with one row and three columns.  The left and right cell have images with width=100% height=100% so they can stretch.  The middle cell has to be a background image because there is the button text in the cell.  The image tiles which is not very nice if you are going for 3D gradient effect.
ASKER CERTIFIED SOLUTION
Avatar of dgooding
dgooding

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I definitely will not do it the way that is described in that post because I don't want to rely on Javascript being turned on.  None the less I did not think of that and it did not come up in my search. That sort of technique would definitely do the job.
Glad I could help....  I think...  :)