Challenge - 5 Problems
Interactive States Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Why do interactive states need styling?
Which of the following best explains why styling interactive states like hover and focus is important in web design?
Attempts:
2 left
💡 Hint
Think about how you know a button is clickable or selected when you use a website.
✗ Incorrect
Interactive states like hover and focus provide visual clues that help users understand which elements they can interact with and what will happen when they do. This improves usability and accessibility.
📝 Syntax
intermediate1:30remaining
Tailwind CSS: How to style a button on hover
Which Tailwind CSS class correctly changes the background color of a button to blue when hovered?
Attempts:
2 left
💡 Hint
Tailwind uses the format
hover:property-value to style hover states.✗ Incorrect
In Tailwind CSS, the correct syntax to change background color on hover is to prefix the class with
hover:. So hover:bg-blue-700 applies the darker blue on hover.❓ rendering
advanced2:00remaining
What happens when focus styles are missing?
Consider a button styled with Tailwind CSS but missing focus styles. What is the most likely result when a keyboard user navigates to this button?
Attempts:
2 left
💡 Hint
Think about how keyboard users know which element is active without a mouse.
✗ Incorrect
Without focus styles, keyboard users cannot see which element is currently selected, making navigation confusing and reducing accessibility.
❓ selector
advanced1:30remaining
Tailwind CSS: Which class applies styles only on focus?
Which Tailwind CSS class applies a red border only when an input field is focused?
Attempts:
2 left
💡 Hint
Tailwind uses
focus: prefix for focus states.✗ Incorrect
The correct syntax to style focus states in Tailwind is
focus: followed by the style class. So focus:border-red-500 applies a red border on focus.❓ accessibility
expert2:00remaining
Why is styling focus states critical for accessibility?
Which statement best explains why visible focus styles are essential for web accessibility?
Attempts:
2 left
💡 Hint
Focus styles are mainly for users who do not use a mouse.
✗ Incorrect
Keyboard users depend on visible focus indicators to understand where they are on the page. Without these styles, navigation becomes confusing and inaccessible.