Use <img>
with position:fixed;top:0;left:0;width:100%;height:100%;
and negative z-index
. Unfortunately, there is no way to implement this behavior in IE 8 using only CSS.
See the following article for more information: How do you stretch the background image on a web page .
If you want to use the image as the background for this <div>
, try the following approach:
<div class="fullbackground"> <img class="fullbackground" src="yourImageSrc" /> </div>
.fullbackground{ position:relative; } img.fullbackground{ position:absolute; z-index:-1; top:0; left:0; width:100%; height:100%; }
source share