0
0
Tailwindmarkup~20 mins

Column spanning in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
๐ŸŽ–๏ธ
Grid Master: Column Spanning
Get all challenges correct to earn this badge!
Test your skills under time pressure!
โ“ layout
intermediate
2:00remaining
What is the visual layout of this grid with column spanning?
Consider a 3-column grid where the first item spans 2 columns. What will the layout look like?
Tailwind
<div class="grid grid-cols-3 gap-4">
  <div class="col-span-2 bg-blue-500 text-white p-4">Item 1</div>
  <div class="bg-green-500 text-white p-4">Item 2</div>
  <div class="bg-red-500 text-white p-4">Item 3</div>
</div>
AItem 1 takes first two columns in the first row; Item 2 is in the third column of the first row; Item 3 is below Item 1 in the second row, first column.
BItem 1 takes all three columns in the first row; Item 2 and Item 3 are side by side in the second row.
CItem 1 takes first two columns in the first row; Item 2 is below Item 1 in the second row, first column; Item 3 is below Item 2 in the third row, first column.
DItem 1 takes first two columns in the first row; Item 2 is in the third column of the first row; Item 3 is below Item 2 in the second row, third column.
Attempts:
2 left
๐Ÿ’ก Hint
Remember that grid items fill rows left to right, top to bottom, and spanning columns affects placement of following items.
โ“ selector
intermediate
1:00remaining
Which Tailwind class makes an element span 3 columns in a grid?
You want a grid item to cover exactly 3 columns. Which class should you use?
Acol-span-full
Bcol-start-3
Ccol-end-3
Dcol-span-3
Attempts:
2 left
๐Ÿ’ก Hint
The class name for spanning columns starts with 'col-span-' followed by the number of columns to span.
๐Ÿง  Conceptual
advanced
1:30remaining
What happens if a grid item spans more columns than the grid has?
If a grid has 4 columns and an item uses col-span-6, what will happen?
AThe item will overflow outside the grid container.
BThe item will cause a layout error and not render.
CThe item will span all 4 columns, ignoring the extra span.
DThe item will automatically wrap to the next row.
Attempts:
2 left
๐Ÿ’ก Hint
Think about how CSS grid handles spans larger than the grid size.
โ“ accessibility
advanced
2:00remaining
How does column spanning affect keyboard navigation in grids?
If a grid item spans multiple columns, what should you consider for keyboard users?
AUse tabindex="-1" on the spanning item to prevent focus.
BEnsure the item has a clear focus style and logical tab order despite spanning columns.
CRemove the item from tab order because spanning confuses keyboard users.
DAdd aria-hidden="true" to the spanning item to skip it in navigation.
Attempts:
2 left
๐Ÿ’ก Hint
Think about how users navigate with keyboard and how focus moves in grids.
โ“ rendering
expert
2:30remaining
What is the rendered width of a grid item with col-span-2 in a 4-column grid with 1rem gap?
Given a grid container 40rem wide with 4 equal columns and 1rem gap between columns, what is the width of an item with col-span-2?
A19.5rem
B20rem
C18.5rem
D21rem
Attempts:
2 left
๐Ÿ’ก Hint
Calculate total gaps width, subtract from container width, then divide by columns and multiply by span count.