Intermediate
HTML & CSS
Q43 / 100
What is the difference between "position: relative" and "position: absolute"?
Correct! Well done.
Incorrect.
The correct answer is B) relative positions an element relative to its normal position (still occupying space in the flow), while absolute removes the element from the normal flow and positions it relative to its nearest positioned ancestor
B
Correct Answer
relative positions an element relative to its normal position (still occupying space in the flow), while absolute removes the element from the normal flow and positions it relative to its nearest positioned ancestor
Explanation
relative keeps the element in its normal flow position but allows offsetting via top/left/etc.; absolute takes the element out of the flow entirely, positioning it relative to the nearest ancestor with a non-static position (or the viewport if none).
Progress
43/100