1D0-720 · Question #69
Which CSS property is used to position an element relative to its normal position?
The correct answer is C. position: relative. position: relative places an element relative to where it would normally appear in the document flow, allowing you to offset it with top, right, bottom, or left without removing it from the flow. position: absolute (A) removes the element from normal flow and positions it…
Question
Which CSS property is used to position an element relative to its normal position?
Options
- Aposition: absolute;
- Bposition: fixed;
- Cposition: relative;
- Dposition: static;
How the community answered
(40 responses)- A5% (2)
- B3% (1)
- C90% (36)
- D3% (1)
Explanation
position: relative places an element relative to where it would normally appear in the document flow, allowing you to offset it with top, right, bottom, or left without removing it from the flow. position: absolute (A) removes the element from normal flow and positions it relative to its nearest positioned ancestor, not its own original position. position: fixed (B) anchors the element to the viewport, so it stays put during scrolling. position: static (D) is the default - it ignores any offset properties entirely and simply follows normal document flow.
Memory tip: Think relative = "relative to myself" - the element remembers where it started and shifts from that point.
Topics
Community Discussion
No community discussion yet for this question.