HTML & CSS · Junior · Question 19 of 75

How does an element with position: relative; top: 10px behave?

Explanation

relative visually shifts the element relative to where it would be in normal flow, but its space isn't released - neighbors don't move. relative is also often set on a parent to make it the reference point for absolutely positioned children. Positioning relative to the window is fixed.

Further reading

Problem with a question

HTML & CSS · Junior · question 19

Test yourself

Take the HTML & CSS · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz