Html – Stretch and scale CSS background

csshtml

Is there a way to get a background in CSS to stretch or scale to fill its container?

Best Solution

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.