blob: 60a86e4cd2476d0f9f295d7c02d55a83faf5dcce [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Position fixed</title>
<script src="../resources/mock_scrollbars.js"></script>
<style type="text/css" media="screen">
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
body {
height: 1000px;
width: 1000px;
}
#fixed {
position: fixed;
top: 0;
left: 0;
height: 100px;
width: 100px;
opacity: 0.8; /* makes this a compositing layer without assigning a transform */
background-color: orange;
}
.box {
height: 50px;
width: 50px;
background-color: green;
}
.compositing {
transform: translateZ(0);
}
p {
position: absolute;
left: 50px;
top: 150px;
}
</style>
<script type="text/javascript" charset="utf-8">
window.addEventListener('load', function() {
window.scrollBy(50, 50);
}, false);
</script>
</head>
<body>
<p>You should see a green square in the top left corner of an orange box.</p>
<div id="fixed">
<div class="compositing box">
</div>
</div>
</body>
</html>