If you're open to a solution that involves both HTML and CSS, you can mimic the behavior of background-size: cover
by using an img
tag.
HTML:
<body>
<div id="image-matte">
<img src="..."/>
</div>
... Page content below ...
</body>
CSS:
#image-matte {
position: fixed;
top: 0%;
left: -50%;
width: 200%;
height: 200%;
}
#image-matte img {
display: block;
margin: auto;
min-height: 50%;
min-width: 50%;
}
/* Overlay to prevent pointer interaction */
#image-matte:after {
content: '';
display: block;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
UPDATE: For a vertically and horizontally centered background image, create a table/table-cell relationship between the wrapper div and an inner div containing the image. Here's how the HTML and CSS would be structured:
HTML:
<div id="image-matte">
<div>
<img src="..."/>
</div>
</div>
CSS:
#image-matte {
position: fixed;
display: table;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
text-align: center;
}
#image-matte div {
vertical-align: middle;
display: table-cell;
}
#image-matte img {
position: relative;
text-align: center;
min-height: 50%;
min-width: 50%;
}
/* Overlay to prevent pointer interaction */
#image-matte:after {
content: '';
display: block;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
See a working example here: http://jsfiddle.net/qkpvb/