0
0
Tailwindmarkup~20 mins

Row spanning in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Row Spanning Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
layout
intermediate
2:00remaining
What is the visual result of this Tailwind CSS grid with row-span?

Consider this HTML snippet using Tailwind CSS classes:

<div class="grid grid-cols-3 gap-4">
  <div class="row-span-2 bg-blue-500 text-white p-4">A</div>
  <div class="bg-red-500 text-white p-4">B</div>
  <div class="bg-green-500 text-white p-4">C</div>
  <div class="bg-yellow-500 text-white p-4">D</div>
</div>

What will you see rendered in the browser?

Tailwind
<div class="grid grid-cols-3 gap-4">
  <div class="row-span-2 bg-blue-500 text-white p-4">A</div>
  <div class="bg-red-500 text-white p-4">B</div>
  <div class="bg-green-500 text-white p-4">C</div>
  <div class="bg-yellow-500 text-white p-4">D</div>
</div>
AA block spans two rows in the first column; B and C appear to the right in the first row; D appears below B in the second row.
BA block spans two rows in the first column; B appears below A in the first column; C and D appear in the second and third columns of the first row.
CA block spans two rows in the first column; B, C, and D appear all in the second row across the three columns.
DA block spans two rows in the first column; B, C, and D appear stacked vertically in the second column.
Attempts:
2 left
💡 Hint

Remember that row-span-2 makes the element cover two rows vertically in the grid.

selector
intermediate
1:00remaining
Which Tailwind class correctly makes a grid item span 3 rows?

You want a grid item to cover three rows vertically in a Tailwind CSS grid. Which class should you use?

Arow-start-3
Brow-span-3
Ccol-span-3
Drow-end-3
Attempts:
2 left
💡 Hint

Think about the difference between row-span and col-span.

🧠 Conceptual
advanced
1:30remaining
What accessibility consideration is important when using row spanning in grids?

When using row spanning in CSS grids, what should you keep in mind to maintain good accessibility?

AAdd <code>aria-rowspan</code> attributes to all grid items manually.
BUse only <code>row-span-1</code> to avoid confusion for screen readers.
CAvoid using grid layouts altogether for accessibility.
DEnsure the reading order in the HTML matches the visual order, so screen readers read content logically.
Attempts:
2 left
💡 Hint

Think about how screen readers read content versus how it looks visually.

📝 Syntax
advanced
1:00remaining
What error occurs if you write row-span2 instead of row-span-2 in Tailwind?

Consider this Tailwind class: row-span2. What happens when you use it in your HTML?

Tailwind
<div class="grid grid-cols-3">
  <div class="row-span2 bg-blue-500">A</div>
</div>
AThe browser throws a syntax error and stops rendering.
BThe element spans 2 rows as expected.
CThe class is ignored; the element does not span rows because the class is invalid.
DThe element spans 1 row but with a warning in the console.
Attempts:
2 left
💡 Hint

Tailwind classes must match exact patterns to apply styles.

rendering
expert
1:30remaining
How many grid cells does this element cover with row-span-3 col-span-2 in a 4x4 grid?

Given a 4 rows by 4 columns grid, an element has classes row-span-3 col-span-2. How many grid cells does it cover?

Tailwind
<div class="grid grid-cols-4 grid-rows-4 gap-2">
  <div class="row-span-3 col-span-2 bg-purple-600 text-white p-4">X</div>
  <!-- other grid items -->
</div>
A6 cells
B5 cells
C8 cells
D3 cells
Attempts:
2 left
💡 Hint

Multiply the number of rows spanned by the number of columns spanned.