Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS background image size 50%

Tags:

css

My website has the following CSS making an image stick to the bottom of the site.

#wrapper{
min-height:100%;
background:#fff url(grafikk/bg-footer.gif) no-repeat 50% 100%;
width:100%;
overflow:hidden;
}

It words great - the picture is centered and stick to the bottom of the page.

But I'd like to set the picture width to 50% of the original PNG. The PNG is 640px wide, so setting it to 320px is also ok.

How could I do that?

(I was unable to find what the different properties of the background-setting actually mean.)

like image 353
Publicus Avatar asked Oct 14 '25 15:10

Publicus


1 Answers

You can actually use pixel values in background-size:

background-size: 320px 100%;
like image 75
José Tomás Tocino Avatar answered Oct 20 '25 05:10

José Tomás Tocino



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!