0
0
Tailwindmarkup~20 mins

Overflow handling in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Overflow Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding overflow-x behavior in Tailwind CSS
What will happen if you apply overflow-x-auto to a container with content wider than the container's width?
Tailwind
<div class="w-48 overflow-x-auto border border-gray-400">
  <div class="w-96 bg-blue-200">Wide content inside</div>
</div>
AThe container will show a horizontal scrollbar allowing you to scroll the wide content.
BThe content will be clipped and hidden without any scrollbar.
CThe container will expand to fit the wide content, ignoring the fixed width.
DThe content will wrap to fit inside the container width automatically.
Attempts:
2 left
💡 Hint
Think about what overflow-x-auto does when content is wider than its container.
📝 Syntax
intermediate
1:30remaining
Which Tailwind class correctly hides overflow content on both axes?
You want to hide any content that overflows the container horizontally and vertically. Which Tailwind CSS class should you use?
Aoverflow-x-hidden
Boverflow-hidden
Coverflow-y-auto
Doverflow-scroll
Attempts:
2 left
💡 Hint
Consider which class affects both horizontal and vertical overflow.
rendering
advanced
2:00remaining
Visual effect of overflow-y-scroll on a fixed height container
Given this container with fixed height and overflow-y-scroll, what will you see in the browser?
Tailwind
<div class="h-24 overflow-y-scroll border border-gray-500">
  <p>Line 1</p>
  <p>Line 2</p>
  <p>Line 3</p>
  <p>Line 4</p>
  <p>Line 5</p>
  <p>Line 6</p>
</div>
AContent clipped with no scrollbar visible.
BAll lines visible without scrollbar because content fits inside height.
CA fixed height box with vertical scrollbar allowing scrolling through all lines.
DHorizontal scrollbar visible because of overflow-y-scroll.
Attempts:
2 left
💡 Hint
Think about what overflow-y-scroll does when content height exceeds container height.
selector
advanced
2:00remaining
Which Tailwind class combination prevents horizontal overflow but allows vertical scrolling?
You want to prevent horizontal overflow but allow vertical scrolling if content is tall. Which combination of Tailwind classes achieves this?
Aoverflow-scroll overflow-x-hidden
Boverflow-x-auto overflow-y-hidden
Coverflow-hidden overflow-y-scroll
Doverflow-x-hidden overflow-y-auto
Attempts:
2 left
💡 Hint
Consider which classes control overflow on each axis separately.
accessibility
expert
2:30remaining
Ensuring accessible scrollable regions with Tailwind overflow classes
When creating a scrollable container using Tailwind's overflow classes, what should you do to ensure keyboard users can navigate the scrollable content?
Tailwind
<div class="h-40 overflow-auto border p-2">
  <!-- long content here -->
</div>
AAdd <code>tabindex="0"</code> to the container so it can receive keyboard focus.
BNo extra attributes needed; overflow classes handle accessibility automatically.
CAdd <code>aria-hidden="true"</code> to hide the container from screen readers.
DUse <code>role="presentation"</code> on the container to improve keyboard navigation.
Attempts:
2 left
💡 Hint
Think about how keyboard users can focus and scroll inside a div.