0
0
Tailwindmarkup~5 mins

Top, right, bottom, left offsets in Tailwind - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What do the top, right, bottom, and left offsets control in CSS positioning?
They control how far an element is placed from the respective edges of its nearest positioned ancestor or the viewport if none is positioned.
Click to reveal answer
beginner
How do you apply a top offset of 1rem using Tailwind CSS?
Use the class top-4 because Tailwind's spacing scale uses 1 unit = 0.25rem, so 4 units = 1rem.
Click to reveal answer
beginner
Which CSS property must be set for top, right, bottom, or left offsets to work?
The element must have a position value other than static, like relative, absolute, or fixed.
Click to reveal answer
beginner
In Tailwind, what does the class right-0 do?
It sets the element's right offset to 0, placing it flush against the right edge of its positioned ancestor.
Click to reveal answer
intermediate
How can you set negative left offset in Tailwind CSS?
Use a negative class like <code>-left-4</code> to move the element 1rem to the left beyond its container.
Click to reveal answer
Which Tailwind class sets an element 2rem from the top?
Atop-1
Btop-2
Ctop-4
Dtop-8
What must you add to an element for top/right/bottom/left offsets to take effect?
Adisplay: block
Bposition: relative or absolute
Cmargin: auto
Dfloat: left
What does the Tailwind class -bottom-6 do?
AMoves element 1.5rem above its container
BMoves element 1.5rem below its container
CMoves element 6rem below its container
DMoves element 6rem above its container
If an element has position: absolute and left-0, where will it be placed?
AAt the right edge of its container
BAt the left edge of the viewport always
CAt the left edge of its nearest positioned ancestor
DCentered horizontally
Which Tailwind class sets an element flush against the right edge?
Aright-0
Bleft-0
Ctop-0
Dbottom-0
Explain how top, right, bottom, and left offsets work with positioned elements in Tailwind CSS.
Think about how CSS positioning and Tailwind spacing classes combine.
You got /4 concepts.
    Describe how you would position an element 1rem from the top and 2rem from the right using Tailwind CSS.
    Recall Tailwind spacing scale and position requirement.
    You got /3 concepts.