<!DOCTYPE HTML> | |
<style> | |
body { | |
margin: 0 | |
} | |
#scroller { | |
position: relative; | |
top: -150px; | |
left: -50px; | |
overflow: scroll; | |
height: 300px; | |
width: 300px; | |
background-color: red; | |
} | |
#outer { | |
position: absolute; | |
top: 150px; | |
left: 50px; | |
width: 250px; | |
height: 300px; | |
overflow: hidden; | |
background-color: blue; | |
} | |
#scrolled { | |
height: 1000px; | |
width: 250px; | |
background-color: green; | |
} | |
#fixed { | |
position: absolute; | |
height: 100px; | |
width: 100px; | |
background-color: green; | |
top: 250px; | |
left: 50px; | |
} | |
</style> | |
<div id="outer"> | |
<div id="scroller"> | |
<div id="scrolled"></div> | |
</div> | |
<div id="fixed"></div> | |
</div> |