Position controls how an element is placed on a webpage.
- static - Default position
- relative - Moves relative to its original position.
- absolute - Positions relative to its nearest positioned parent.
- fixed - Stays in the same place on the screen while scrolling.
- Sticky - Sticks to screen after reaching a scroll position.
.box {
position : relative;
top : 10px; //moves down
left : 20px; //moves right
Top comments (0)