Which statement best describes the four primary CSS position values (static, relative, absolute, fixed)?

Prepare for the CSS Mastery SAD Maintenance and CSA Stand Ups Test. With flashcards and multiple choice questions, ready yourself for the exam with hints and explanations for every question. Ace your exam today!

Multiple Choice

Which statement best describes the four primary CSS position values (static, relative, absolute, fixed)?

Explanation:
Positioning in CSS controls where an element sits in the page and how offsets move it. The four primary values differ in two key ways: whether the element stays in the normal document flow, and what coordinate reference they use for positioning. Static is the default. The element remains in the normal flow and top/right/bottom/left have no effect. Relative keeps the element in the normal flow, but you can nudge it using offset properties. The element’s original space stays in the layout, while the visual position shifts. Absolute removes the element from the normal flow and positions it relative to the nearest ancestor that has a position other than static. If there’s no such ancestor, it’s positioned relative to the initial containing block (often the viewport). Fixed also removes the element from the normal flow, but its position is relative to the viewport, so it doesn’t move when the page is scrolled. Among the options, the description that aligns with these behaviors is the one that notes static as default, relative offsets from the element’s normal position, absolute relative to the nearest positioned ancestor, and fixed relative to the viewport. The other statements are less accurate or refer to concepts (like sticky or claiming absolute and fixed behave the same) that don’t match how positioning actually works.

Positioning in CSS controls where an element sits in the page and how offsets move it. The four primary values differ in two key ways: whether the element stays in the normal document flow, and what coordinate reference they use for positioning.

Static is the default. The element remains in the normal flow and top/right/bottom/left have no effect.

Relative keeps the element in the normal flow, but you can nudge it using offset properties. The element’s original space stays in the layout, while the visual position shifts.

Absolute removes the element from the normal flow and positions it relative to the nearest ancestor that has a position other than static. If there’s no such ancestor, it’s positioned relative to the initial containing block (often the viewport).

Fixed also removes the element from the normal flow, but its position is relative to the viewport, so it doesn’t move when the page is scrolled.

Among the options, the description that aligns with these behaviors is the one that notes static as default, relative offsets from the element’s normal position, absolute relative to the nearest positioned ancestor, and fixed relative to the viewport. The other statements are less accurate or refer to concepts (like sticky or claiming absolute and fixed behave the same) that don’t match how positioning actually works.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy