Challenge - 5 Problems
Grid Mastery Badge
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 class
<div class="grid grid-cols-3 gap-4">...</div>
What does the class
grid-cols-3 do?Tailwind
<div class="grid grid-cols-3 gap-4">Content</div>Attempts:
2 left
💡 Hint
The class
grid-cols-3 controls the number of columns in a grid layout.✗ Incorrect
The
grid-cols-3 class in Tailwind CSS sets the grid container to have exactly 3 columns of equal width. It does not affect rows or flexbox behavior.🧠 Conceptual
intermediate2:00remaining
How does Tailwind CSS define grid columns with different widths?
Which Tailwind CSS class would you use to create a grid with 4 columns where the first column is twice as wide as the others?
Attempts:
2 left
💡 Hint
Tailwind allows custom grid column sizes using square brackets with CSS values.
✗ Incorrect
The class
grid-cols-[2fr_1fr_1fr_1fr] uses Tailwind's arbitrary value feature to set the first column to 2 fractions wide and the others to 1 fraction each.❓ selector
advanced2:00remaining
Which Tailwind class correctly creates a responsive grid with 2 columns on small screens and 4 columns on large screens?
Given the following options, which one will create a grid that has 2 columns on screens smaller than 1024px and 4 columns on screens 1024px and wider?
Attempts:
2 left
💡 Hint
Tailwind uses prefixes like
lg: to apply styles at certain screen sizes.✗ Incorrect
The class
grid-cols-2 applies by default (small screens). The lg:grid-cols-4 applies when the screen is large (1024px+), changing columns to 4.❓ rendering
advanced2:00remaining
What will be the visual layout of this grid container?
Analyze this HTML snippet:
How will the items be arranged visually?
<div class="grid grid-cols-3 gap-2"> <div>A</div> <div>B</div> <div>C</div> <div>D</div> </div>
How will the items be arranged visually?
Tailwind
<div class="grid grid-cols-3 gap-2">
<div>A</div>
<div>B</div>
<div>C</div>
<div>D</div>
</div>Attempts:
2 left
💡 Hint
The grid has 3 columns, so items fill rows left to right.
✗ Incorrect
With 3 columns, the first 3 items fill the first row. The 4th item starts the second row in the first column.
❓ accessibility
expert3:00remaining
Which approach improves accessibility for a grid layout of images with captions?
You have a grid of images with captions inside a
div using Tailwind grid classes. Which method best improves accessibility for screen readers?Attempts:
2 left
💡 Hint
Semantic HTML elements help screen readers understand content better.
✗ Incorrect
Using
<figure> and <figcaption> pairs is the best semantic way to associate images with captions, improving accessibility.