<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
height: 2000px; | |
margin: 0; | |
} | |
.fixed { | |
position: absolute; | |
top: 100px; | |
height: 200px; | |
width: 100%; | |
background-color: green; | |
} | |
</style> | |
<script> | |
window.addEventListener('load', () => { | |
internals.unconstrainedScrollTo(document.scrollingElement, 0, -100); | |
}, false); | |
</script> | |
</head> | |
<body> | |
<div class="fixed"></div> | |
</body> | |
</html> |