Recall & Review
beginner
What does position: relative do in React Native?
It moves the element relative to its normal position without affecting other elements' layout.
Click to reveal answer
beginner
What is the effect of position: absolute in React Native?
It removes the element from the normal layout flow and positions it relative to its closest positioned ancestor.
Click to reveal answer
beginner
Which CSS properties are commonly used with
position: absolute to place an element?Top, right, bottom, and left are used to specify the exact position of the element.
Click to reveal answer
intermediate
If a parent has
position: relative, how does it affect a child with position: absolute?The child will be positioned relative to the parent, not the whole screen.
Click to reveal answer
beginner
Why might you use
position: relative instead of position: absolute?To shift an element slightly without removing it from the layout flow, keeping space reserved.
Click to reveal answer
What happens to an element with
position: absolute in React Native?✗ Incorrect
An absolutely positioned element is removed from the normal layout and positioned relative to the closest ancestor with position set.
Which property is NOT used to position an element with
position: absolute?✗ Incorrect
Margin affects spacing but does not directly position an absolutely positioned element.
If no ancestor has a position set, where does an absolute element position itself?
✗ Incorrect
Without a positioned ancestor, absolute elements position relative to the root container or screen.
What does
position: relative NOT do?✗ Incorrect
Relative positioning keeps the element in the layout flow; it does not remove it.
Which is a good use case for
position: absolute?✗ Incorrect
Absolute positioning is great for overlays like badges that need to float over other elements.
Explain how
position: relative and position: absolute work together in React Native layout.Think about how a child element can move inside a parent container.
You got /3 concepts.
Describe a real-life example where you would use
position: absolute in a mobile app UI.Imagine placing a small icon on top of a profile picture.
You got /3 concepts.