Yellowline - Lab Equipment - Gym Lockers - Livescore euro 2008 - Watch Anime - Debt Consolidation

PDA

View Full Version : stretching images


david_sakh
Oct 19th 2004, 9:15 pm
.button {
background-image: url("http://www.exclusivefreegames.com/images/btn80x25.jpg");
width: 80;
height: 25;
valign: middle;
}

I want that image to stretch to fit a table cell. Can anyone please help? :(

I want to use an image as a background for my buttons. It was working for a while but the size in CSS isn't applying to the td, so i figured my only course of action would be to stretch.

Lever
Oct 20th 2004, 12:23 am
If you were going to stretch that image to fit the table cell, then I guess you'd have to set width: to the width of the cell not the img. However IMO that usually looks cheap, so you'd be best off designing a graphic to the exact size you want

HTH

mopacfan
Oct 20th 2004, 7:07 am
The better way to do this is to create a left and a right edge of the button and then create a filler image for the background. Use three TD's. Left side / center / Right side. Then the buttons will be fillled properly and won't look dorky from being stretched.

T0PS3O
Oct 20th 2004, 7:23 am
Stretching is pretty tough on the CPU apparently. The filler option sounds best to me.

david_sakh
Oct 20th 2004, 8:09 am
The better way to do this is to create a left and a right edge of the button and then create a filler image for the background. Use three TD's. Left side / center / Right side. Then the buttons will be fillled properly and won't look dorky from being stretched.

best idea ive heard all day. thx a bunch.

mopacfan
Oct 20th 2004, 8:55 am
Glad I could help. :)