views:

142

answers:

2

How can I stretch background image of a table cell with CSS? I have Googled without results.

When you set background image of a cell and the background size is smaller than the cell, then it will be repeated.

How can I force this background to stretch the entire table cell instead?

A: 

You can't stretch a background image.

If you want to stretch an image, you have to put it in an img tag. You can use absolute positioning to put content on top of the image.

Guffa
but i made this thread for tables / absolute position not ok for background image of tables / any other idea ?
LostLord
@LostLord: No, you simply can't stretch a background image, unless you want to wait until CSS 3 compatible browsers is a lot more common.
Guffa
+1  A: 

It is possible to stretch a background image using vendor-specific CSS 3 rules. Not supported by older browsers and IE, though, so it's of very limited use at the moment.

Pekka
backgroung size is very very limited / any other idea ?
LostLord
@LostLord not really, not without complicated jQuery workarounds. What do you need to do?
Pekka