0
0
Tailwindmarkup~20 mins

Hidden and visibility control in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Visibility Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2:00remaining
What will be visible in the browser?
Given the following HTML snippet styled with Tailwind CSS, which text will be visible when rendered in a browser?
Tailwind
<div class="hidden md:block">Hello</div><div class="block md:hidden">World</div>
AOnly 'Hello' is visible on medium and larger screens
BOnly 'World' is visible on medium and larger screens
CBoth 'Hello' and 'World' are visible on all screen sizes
DNeither 'Hello' nor 'World' is visible on any screen size
Attempts:
2 left
💡 Hint
Think about how Tailwind's responsive prefixes like md: affect visibility classes.
selector
intermediate
1:30remaining
Which Tailwind class hides an element but keeps its space?
In Tailwind CSS, which class hides an element visually but still keeps its space in the layout?
Ainvisible
Bhidden
Copacity-0
Dsr-only
Attempts:
2 left
💡 Hint
Consider the difference between removing an element from layout vs making it transparent.
🧠 Conceptual
advanced
2:00remaining
What is the effect of combining 'hidden' and 'sr-only' classes?
If an element has both hidden and sr-only classes in Tailwind CSS, what will be the result?
AThe element is hidden visually but accessible to screen readers
BThe element is visible visually but hidden from screen readers
CThe element is hidden visually and from screen readers
DThe element is visible both visually and to screen readers
Attempts:
2 left
💡 Hint
Consider which class takes precedence and what each class does.
layout
advanced
1:30remaining
How does 'invisible' affect layout compared to 'hidden'?
Consider two divs styled with Tailwind CSS: one with invisible and one with hidden. How do they differ in layout behavior?
ABoth remove the element from the layout flow
B<code>invisible</code> keeps space, <code>hidden</code> removes space
C<code>hidden</code> keeps space, <code>invisible</code> removes space
DBoth keep the element visible but transparent
Attempts:
2 left
💡 Hint
Think about how CSS display and visibility properties affect layout.
accessibility
expert
2:30remaining
Which Tailwind class combination ensures an element is hidden visually but accessible to screen readers and keyboard navigation?
You want to hide a button visually but keep it accessible to screen readers and keyboard users. Which Tailwind CSS class or combination achieves this?
Ahidden
Binvisible focusable
Copacity-0 pointer-events-none
Dsr-only
Attempts:
2 left
💡 Hint
Consider the purpose of the sr-only class and how it affects accessibility.