Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table background fit

Status
Not open for further replies.

KryptoS

Programmer
Feb 7, 2001
240
BE
Hey,

How do i make the background image stretch to fit the table??? I do not want the image to repeat. It should only be a single image stretched as per resolution or size of the screen as the table does the same.(The table in turn has cells which has text content. )


greetz

The One And Only KryptoS
 
True... CSS currently doesn't support any kind of background scaling.
It is possible to simulate stretching by using DIV tag, a little bit of javascript and Z-index.

For IE5.5 and higher this should work:
Code:
<style type="text/css">
.blah
{	filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=image.gif, sizingmethod=scale)"
}
</style>
 
Hi,

Like Dan says -you can't stretch the background image. However, you can control how the background image is displayed, using CSS:

[tt]
Property : background-attachment
Values : scroll
- The image will scroll with page-scroll
: fixed
- The image will stay put

Property : background-image
Values : url(imageName)
- Example : url(bg.gif);
: none
- No background image is displayed

Property : background-position
Values : top left
: top center
: top right
: center left
: center center
: center right
: bottom left
: bottom center
: bottom right
: x-% y-% (both or either)
: x-pos y-pos (both or either)

Property : background-repeat
Values : repeat
- This is the default (as if omitted)
: repeat-x
- Image repeated in x-direction only
: repeat-y
- Image repeated in y-direction only
: no-repeat
- Image will be shown once only (in the current cell)

[/tt]

Hope this helps.

Good Luck §:O)


Jakob


Property :
Values :
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top