How to control the image resolution painted as the background for a div
I am trying to paint an image as the background for a div element. But not able to figure out on how to control the resolution of the image.
My image resolution is 1400X900 px. I wanted to paint that image so that it wont be trimmed and fits to the screen. How to set the image size so that it will be fitted to screen? I tried using background-size but it is not working in I.E.
below is my div element
<div style="background:url('...');"> some more elements </div>
background-size (background-size: contain for instance) is the way to go. However, as you yourself note, this doesn't work in IE 8 and below.
For old IEs you can consider using background-size polyfill, which emulates background-size.
You could write a script that does the same thing but that might be more trouble than it's worth.
Use Css3 option background-size.
For example background-size:100% 100%;