This course will be retired on July 12, 2021. We recommend "Mobile-First CSS Layout" for up-to-date content.
Positioning Elements Relative to Other Elements3:46 with Guil Hernandez
Absolute positioning has certain limitations by itself because the positioning is often in relation to the browser viewport. Sometimes you want to place an element in relation to another element and even have it stick with that element if it moves in the design. That's when relative positioning comes in handy.
- Absolute and relative positioning work hand in hand.
- An element with relative positioning gives you the control to absolutely position elements anywhere inside it.
- An element with absolute positioning is always relative to the first parent that has a relative position.
- If no parent element has a relative position, the browser viewport is the positioning context by default.
You need to sign up for Treehouse in order to download course files.Sign up