abspos-static-position-ref.html (353B)
1 <!DOCTYPE html> 2 <html> 3 <style> 4 body { 5 margin: 0; 6 } 7 .parent { 8 margin-top: 100px; 9 margin-left: 25%; 10 height: 200px; 11 outline: 4px solid black; 12 } 13 14 .abspos { 15 position: absolute; 16 width: 200px; 17 height: 200px; 18 background-color: green; 19 } 20 </style> 21 <body> 22 <div class="parent"> 23 <div class="abspos"></div> 24 </div> 25 </body> 26 </html>