There is a way to do this in CSS3:
div {background-image: url(path/to/image); background-size: 100%}
The background-size property is supported only in newer versions of Safari and Opera. For other browsers, you can fill in the spaces around the image with color using the background-color property, for example:
div { background-image: url(path/to/image); background-size: 100%; background-color: #000000; }
Or in abbreviated form:
div {background:#000000 url(path/to/image) no-repeat; background-size:100%}
Using this code will stretch the image in browsers with CSS3 support (the latest Opera, Safari, and possibly Firefox). Older browsers and IE will have spaces around the image filled with the specified background color.
vamin
source share