<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=800"> | |
<style> | |
body { | |
margin: 0px; | |
} | |
#abs { | |
position: absolute; | |
left: 0px; | |
top: 0px; | |
background: silver; | |
width: 100px; | |
height: 50vh; | |
} | |
#fixed { | |
position: fixed; | |
right: 0px; | |
top: 0px; | |
background: red; | |
width: 100px; | |
height: 50vh; | |
} | |
#spacer { | |
height: 1000px; | |
width: 800px; | |
} | |
</style> | |
<head> | |
<body> | |
<div id="abs"></div> | |
<div id="fixed"></div> | |
<div id="spacer"></div> | |
</body> | |
</html> |