0
0
Tailwindmarkup~5 mins

Position utilities (relative, absolute, fixed) in Tailwind - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the relative position utility do in Tailwind CSS?
It sets the element's position to relative, allowing you to move it using top, right, bottom, or left without removing it from the normal page flow.
Click to reveal answer
beginner
How does absolute positioning behave in Tailwind CSS?
It removes the element from the normal flow and positions it relative to the nearest positioned ancestor (one with relative, absolute, or fixed).
Click to reveal answer
beginner
What is the effect of the fixed position utility in Tailwind CSS?
It fixes the element relative to the browser window, so it stays in the same place even when you scroll the page.
Click to reveal answer
intermediate
Which Tailwind utility class would you use to move an element 1rem down from its normal position?
Use relative to set position, then top-4 to move it down by 1rem (since 4 = 1rem in Tailwind spacing scale).
Click to reveal answer
intermediate
Why is it important to have a positioned ancestor when using absolute positioning?
Because an absolutely positioned element is placed relative to the nearest ancestor that has a position other than static (like relative or fixed). Without it, it positions relative to the page.
Click to reveal answer
Which Tailwind class sets an element to be positioned relative to its normal spot?
Afixed
Babsolute
Crelative
Dstatic
If you want an element to stay visible in the same spot when scrolling, which Tailwind class do you use?
Afixed
Bsticky
Crelative
Dabsolute
An element with absolute positioning will be placed relative to:
AThe nearest ancestor with position relative, absolute, or fixed
BThe body element always
CThe first child element
DThe viewport only
Which Tailwind class removes an element from the normal document flow?
Arelative
Bblock
Cstatic
Dabsolute
What happens if you use absolute positioning but no ancestor has a position set?
AElement positions relative to the viewport
BElement positions relative to the page (html element)
CElement stays in normal flow
DElement is hidden
Explain how the relative, absolute, and fixed position utilities work in Tailwind CSS and when you might use each.
Think about how each affects the element's position and page flow.
You got /6 concepts.
    Describe why setting a positioned ancestor is important when using absolute positioning in Tailwind CSS.
    Consider what happens if no ancestor has position set.
    You got /4 concepts.