codegurukool.com · Free coding tutorials & online compiler

Home › CSS Tutorial › Position offsets

Position offsets

top, right, bottom, left.

Offsets move positioned elements. They have no effect on static.

Example code

<style>
.p{position:relative;height:120px;background:#eee}
.q{position:absolute;bottom:8px;left:8px;background:navy;color:#fff;padding:6px}
</style>
<div class='p'><div class='q'>Bottom left</div></div>

Run this code in the online editor

← CSS max-widthCSS z-index →