With CSS, how do I resize a background image?

Banana01

New member
I don't need to change the padding, I want to change the size of the background image because its too big for the padding I want. Its cutting off a bunch of the image, I COULD resize the image itself, but I would rather use code to do so. Any properties/values I could use?
I used "background-position" i'm actually using it currently to center the image, but I still need to change the SIZE of the image.
 
You need to resize the image manually with an external program, or you could use a dynamic image with an image.php and change the background to:
url(image.php?src=image.png&width=30&height=60)

source of the image.php
<?php
$image = imagecreatefrompng($_GET['src']);
list($width, $height) = getimagesize($filename);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $_GET['width'], $_GET['height'], $width, $height);
header("Content-type: image/png");
imagepng($image);
?>
 
Back
Top