<!DOCTYPE HTML> | |
<style> | |
body { | |
margin: 0; | |
} | |
div { | |
position: absolute; | |
background-color: green; | |
} | |
.border-box { | |
width: 100px; | |
height: 100px; | |
box-sizing: border-box; | |
} | |
.content-box { | |
width: 60px; | |
height: 60px; | |
box-sizing: content-box; | |
border: blue solid 20px; | |
} | |
</style> | |
<div id="target1" class="content-box" style="top: 0px"></div> | |
<div id="target2" class="border-box" style="top: 200px"></div> |