The first class hover:bg-red-500 is correct. The second class hovertext-white is missing a colon after hover.
Step 2: Confirm correct syntax
The correct class should be hover:text-white with a colon separating hover and the utility.
Final Answer:
Missing colon in second hover class -> Option D
Quick Check:
hover: must separate variant and utility [OK]
Hint: hover: must always have a colon before utility [OK]
Common Mistakes:
Omitting colon after hover
Using invalid color names
Thinking hover can't be used on div
5. You want a button that is gray normally, turns blue on hover, and shows white text only on hover. Which class list achieves this?
hard
A. bg-gray-400 hover:bg-blue-600 text-gray-800 hover:text-white p-3 rounded
B. bg-gray-400 bg-hover-blue-600 text-white hover:text-gray-800 p-3 rounded
C. bg-gray-400 hover:bg-blue-600 hover-text-white text-gray-800 p-3 rounded
D. bg-gray-400 hover:bg-blue-600 text-white hover:text-white p-3 rounded
Solution
Step 1: Identify normal and hover background colors
Normal background should be gray (bg-gray-400), hover background blue (hover:bg-blue-600).
Step 2: Identify text colors
Normal text is gray (text-gray-800), hover text is white (hover:text-white).
Step 3: Check each option
bg-gray-400 hover:bg-blue-600 text-gray-800 hover:text-white p-3 rounded matches all requirements with correct syntax. Others have wrong class names or order.
Final Answer:
bg-gray-400 hover:bg-blue-600 text-gray-800 hover:text-white p-3 rounded -> Option A
Quick Check:
hover: prefix changes styles on mouse hover [OK]
Hint: Use hover: before both bg and text classes for hover styles [OK]
Common Mistakes:
Using incorrect hover syntax like hover-text-white
Setting text color to white normally instead of on hover
Mixing up hover:bg and bg-hover
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.