22 lines
704 B
HTML
22 lines
704 B
HTML
<!DOCTYPE>
|
|
<html>
|
|
<style>
|
|
#element-container-absolute-vmin {
|
|
background:green;
|
|
position:absolute;
|
|
}
|
|
</style>
|
|
<div id="element-container-absolute-vmin">TEST PASSED</div>
|
|
<script>
|
|
function applyStyle() {
|
|
var viewportMinLength = Math.min(window.innerWidth, window.innerHeight);
|
|
var elementStyle = document.getElementById("element-container-absolute-vmin").style;
|
|
elementStyle.top = Math.floor(10 * viewportMinLength / 100) + "px";
|
|
elementStyle.bottom = Math.floor(10 * viewportMinLength / 100) + "px";
|
|
elementStyle.left = Math.floor(10 * viewportMinLength / 100) + "px";
|
|
elementStyle.right = Math.floor(10 * viewportMinLength / 100) + "px";
|
|
}
|
|
applyStyle();
|
|
</script>
|
|
</html>
|