0
0
Tailwindmarkup~5 mins

Gap between flex children in Tailwind - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the gap utility in Tailwind CSS do when used with flex containers?
The gap utility adds consistent space between flex children without adding margin to individual items. It controls the space between items horizontally or vertically depending on flex direction.
Click to reveal answer
beginner
How do you add a 1rem gap between flex children using Tailwind CSS?
Use the class gap-4 on the flex container. Tailwind's gap-4 corresponds to 1rem spacing between children.
Click to reveal answer
intermediate
Why is using gap better than adding margin to flex children for spacing?
Using gap keeps spacing consistent and avoids extra margin on the container edges. It simplifies layout and prevents layout shifts caused by margins.
Click to reveal answer
intermediate
Which CSS property does Tailwind's gap utility control under the hood?
It controls the CSS gap property, which works with flex and grid containers to set spacing between children.
Click to reveal answer
advanced
Can gap be used with flex containers in all browsers?
Most modern browsers support gap with flex containers, but older browsers may not. Always check browser compatibility if supporting legacy browsers.
Click to reveal answer
Which Tailwind class adds a 0.5rem gap between flex children?
Agap-2
Bgap-4
Cgap-1
Dgap-3
What CSS property does Tailwind's gap utility modify?
Amargin
Bpadding
Cgap
Dspace-between
Why is gap preferred over margins for spacing flex children?
AIt avoids extra space on container edges
BIt adds padding inside children
CIt changes flex direction
DIt removes flex wrapping
Which Tailwind class would you use to add a 2rem gap between flex children?
Agap-2
Bgap-6
Cgap-4
Dgap-8
Is the gap property supported in flexbox layouts in modern browsers?
AOnly in Internet Explorer
BYes, in most modern browsers
CNo, only in grid layouts
DNo, it is deprecated
Explain how to add space between flex children using Tailwind CSS and why it is better than using margins.
Think about the CSS property that controls spacing between flex items.
You got /4 concepts.
    Describe the relationship between Tailwind's gap classes and the CSS gap property in flexbox.
    Consider how Tailwind utilities map to CSS properties.
    You got /4 concepts.