Challenge - 5 Problems
Grid Rows Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate2:00remaining
What is the effect of this Tailwind CSS class?
Consider the following HTML snippet using Tailwind CSS:
What does the
<div class="grid grid-rows-3 gap-4"> <div>Item 1</div> <div>Item 2</div> <div>Item 3</div> </div>
What does the
grid-rows-3 class do in this example?Tailwind
<div class="grid grid-rows-3 gap-4"> <div>Item 1</div> <div>Item 2</div> <div>Item 3</div> </div>
Attempts:
2 left
💡 Hint
Think about how grid rows and columns control layout direction.
✗ Incorrect
The
grid-rows-3 class sets the grid to have exactly 3 rows. Each child element is placed in a separate row vertically. It does not affect columns or gaps.🧠 Conceptual
intermediate1:30remaining
How many rows are created by this Tailwind class?
If you use the class
grid-rows-4 on a grid container with 6 child elements, how many rows will the grid have?Attempts:
2 left
💡 Hint
Without specifying grid-cols, the grid uses a single implicit column.
✗ Incorrect
The
grid-rows-4 class creates 4 explicit rows. Since there are 6 items and no columns defined, the grid creates additional implicit rows, resulting in 6 rows, one for each child element.❓ rendering
advanced2:30remaining
What visual layout results from this Tailwind grid?
Given this HTML:
What will be the height of each row visually?
<div class="grid grid-rows-[100px_200px_1fr] gap-2"> <div class="bg-blue-300">Row 1</div> <div class="bg-green-300">Row 2</div> <div class="bg-red-300">Row 3</div> </div>
What will be the height of each row visually?
Tailwind
<div class="grid grid-rows-[100px_200px_1fr] gap-2"> <div class="bg-blue-300">Row 1</div> <div class="bg-green-300">Row 2</div> <div class="bg-red-300">Row 3</div> </div>
Attempts:
2 left
💡 Hint
Custom row sizes in Tailwind use square brackets with CSS values.
✗ Incorrect
The
grid-rows-[100px_200px_1fr] class sets the first row to 100px height, second to 200px, and the third row to 1fr, which fills remaining space.❓ selector
advanced1:00remaining
Which Tailwind class sets exactly 5 grid rows?
You want to create a grid with exactly 5 rows. Which Tailwind CSS class should you use?
Attempts:
2 left
💡 Hint
Tailwind uses the prefix
grid-rows- to define number of rows.✗ Incorrect
The correct class to define 5 rows in a grid is
grid-rows-5. Other options are invalid or define columns.❓ accessibility
expert3:00remaining
How to make a grid with rows accessible for screen readers?
You have a grid with multiple rows defined by Tailwind classes. What is the best way to ensure screen readers understand the row structure?
Attempts:
2 left
💡 Hint
Think about semantic HTML and ARIA roles for structure.
✗ Incorrect
Screen readers rely on semantic HTML and ARIA roles to understand structure. Wrapping row content in semantic elements and adding roles improves accessibility. Tailwind classes alone do not provide semantic meaning.