Covering a page with image in CSS seems troublesome. My prequisities are:
1) Image always fully visible 2) Cover as much as possible 3) Keep aspect ratio 4) Desktop - mobile responsiveness
Any feasible solutions? I've tried the infamous flex-box, basic css, jquery and background-size: contain, but I seem to be missing something.
My goal is to fill the whole page with an image, keep the aspect ratio always correct and fill as much as I can from the screen space (rotation is okay on mobile devices).
.className {
max-width: 100%;
max-height: 100%;
bottom: 0;
left: 0;
margin: auto;
overflow: auto;
position: fixed;
right: 0;
top: 0;
}
EDIT: http://jsfiddle.net/xem36f7h/4/ is behaving correctly besides some weird scrollign with iphone 5S