What visual effect will gap-3 have on the grid cells?
medium
A. No space between grid cells
B. Adds moderate space between all grid cells horizontally and vertically
C. Adds space only between rows
D. Adds space only between columns
Solution
Step 1: Understand the grid setup
The grid has 3 columns and uses gap-3 which adds spacing between all cells horizontally and vertically.
Step 2: Visualize the effect of gap-3
Each cell will have moderate space around it, improving readability and separation.
Final Answer:
Adds moderate space between all grid cells horizontally and vertically -> Option B
Quick Check:
gap-3 = moderate equal gaps [OK]
Hint: gap-3 means moderate space all around grid cells [OK]
Common Mistakes:
Thinking gap-3 adds no space
Confusing gap-3 with gap-x-3 or gap-y-3
Assuming gap-3 affects only rows or columns
4. You want to add horizontal gap 4 and vertical gap 8 between grid cells, but your code uses gap-4 gap-y-8. What is wrong?
medium
A. Both gaps work correctly as intended
B. gap-4 overrides gap-y-8, so vertical gap stays 4
C. gap-y-8 overrides gap-4, so horizontal gap stays 8
D. This syntax causes a syntax error
Solution
Step 1: Understand the class application order
The gap-4 class sets both horizontal and vertical gaps to 1rem. The following gap-y-8 class overrides only the vertical gap to 2rem, leaving the horizontal gap at 1rem.
Step 2: Verify against desired outcome
This results in horizontal gap of 4 and vertical gap of 8, exactly as intended.
Final Answer:
Both gaps work correctly as intended -> Option A
Quick Check:
gap-4 gap-y-8 = x:4 y:8 [OK]
Hint: gap-{size} followed by gap-x/y-{size2} correctly sets directional gaps [OK]
Common Mistakes:
Thinking gap-4 overrides the subsequent gap-y-8
Assuming the gaps add together
Believing this causes a syntax error
5. You have a grid with 4 columns and want to add 1rem horizontal gap and 0.5rem vertical gap between cells. Which Tailwind classes achieve this correctly?
hard
A. gap-x-2 gap-y-4
B. gap-4 gap-2
C. gap-x-4 gap-y-2
D. gap-1 gap-y-0.5
Solution
Step 1: Convert rem values to Tailwind spacing scale
Tailwind spacing scale: 1rem = 4, 0.5rem = 2. So horizontal gap 1rem = gap-x-4, vertical gap 0.5rem = gap-y-2.
Step 2: Choose correct classes for horizontal and vertical gaps
Use gap-x-4 for horizontal and gap-y-2 for vertical gaps to set different sizes.