Is there a way to get a background in CSS to stretch or scale to fill its container?
Use the CSS 3 property background-size
:
#my_container { background-size: 100% auto; /* width and height, can be %, px or whatever. */ }
This is available for modern browsers, since 2012.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With