I have a div, and I want to make a whole background image fit inside the div, even though the image is a little bigger than the div, how would I go about shrinking this dynamically?
Asked
Active
Viewed 85 times
0
-
Duplicate : http://stackoverflow.com/questions/376253/stretch-and-scale-css-background – rlb.usa Jul 26 '10 at 21:12
-
You can't do that with CSS only. It's not for image processing. To do that you need to use a script, server-side(PHP,JSP,etc) or Javascript. – Ventus Jul 26 '10 at 21:12
1 Answers
1
Looks like it is possible in CSS3 but not currently in CSS2
http://www.w3.org/TR/2002/WD-css3-background-20020802/#background-size
This is also a duplicate of this question

Community
- 1
- 1

David Young
- 4,643
- 2
- 21
- 18
-
Even so, it would be best to pre-size the image on the server side. Regardless, +1 for answering the qustion. – George Marian Jul 26 '10 at 21:17