Search code examples
internet-explorercssbackground-image

background-size:cover; alternative for IE6+


I need a quick fix for body{background-size:cover;} to work in IE6+. What is the best way to go about it? JavaScript/jQuery, or some sketchy CSS2 tricks, meaning I will have to put the image in a page element instead of just in the CSS.


Solution

  • If you must do it, it would seem the easiest way would be to use an absolutely positioned image with a height and width of 100%. Then use z-index to get the rest of the content on top of the image.