If you're willing to only support newer browsers, you can experiment with the background-size attribute:
That'll stretch the image, you can also try setting background-size to "cover" or "contain".Code:HTML: <div class="background"></div> CSS: HTML, BODY {margin: 0; padding: 0; width: 100%; height: 100%} .background {height: 100%; width: 100%; background: url(myimage.jpg) no-repeat; background-size: 100% 100%}
Or, if you want to support older browsers, you can stretch an image tag:
Code:HTML: <div class="background"> <img src="myimage.jpg"/> </div> CSS: HTML, BODY {margin: 0; padding: 0; width: 100%; height: 100%} .background {height: 100%; width: 100%;} .background IMG {height: 100%; width: 100%; display: block}




Reply With Quote