Soluzione CSS3, compatibile con Safari 3+, Chrome, IE9+, Opera 10+, Firefox 3.6+:
codice:
html {
background: url(images/background.jpg) no-repeat center center fixed;
-moz-background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Soluzione CSS2, garantito il supporto su tutti i browser moderni, IE8+ incluso:
codice:
#container {
position:fixed;
top:-50%;
left:-50%;
width:200%;
height:200%;
}
#container img {
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
margin:auto;
min-width:50%;
min-height:50%;
}
L’immagine va inserita in un contenitore che si ridimensioni a seconda della risoluzione utilizzata.