Edit This Code:
See Result »
<!DOCTYPE html> <html> <head> <style> div.relative { position: relative; width: 400px; height: 200px; border: 3px solid #8AC007; } div.absolute { position: absolute; top: 80px; width: 200px; height: 100px; border: 3px solid #8AC007; } </style> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?73c27e26f610eb3c9f3feb0c75b03925"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </head> <body> <div class="relative">This div element has position: relative; <div class="absolute">This div element has position: absolute. It is placed 80 pixels below the top edge of the containing positioned element (div with class="relative").</div> </div> </body> </html>
Result: