Auto scale image to fill entire web page
If you have a page size that may not be fixed – but would still like your image (background image) to automatically fill in the entire page, here is a tip.
<div style='position:absolute;z-index:0;left:0;top:0;width:100%;height:100%'>
<img src='mybackground.jpg' style='width:100%;height:100%' alt='[]' />
</div>
This enables the DIV to resize according to the page size (since div is set to 100%).
Anything inside the div gets scaled along with the DIV.
Leave a Reply