The input has the disabled attribute, so disabled styles can apply.
Step 2: Analyze cursor style usage
The cursor style cursor-not-allowed applies always. To apply only when disabled, it should be disabled:cursor-not-allowed.
Final Answer:
Cursor style should use disabled: prefix -> Option A
Quick Check:
Cursor needs disabled: prefix for disabled state [OK]
Hint: Add disabled: prefix to cursor styles for disabled elements [OK]
Common Mistakes:
Forgetting disabled: prefix on cursor
Thinking disabled:bg-gray-300 is wrong
Assuming inputs can't be styled
5. You want a button to have a blue background normally, but when disabled, it should have a gray background and the text should be lighter gray. Which Tailwind classes achieve this?
hard
A. bg-blue-600 disabled:bg-gray-400 text-white text-gray-300
B. bg-blue-600 disabled:bg-gray-400 disabled:text-gray-300 text-white
C. bg-blue-600 bg-gray-400 disabled:text-gray-300 text-white
D. bg-blue-600 disabled:bg-gray-400 text-gray-300 disabled:text-white
Solution
Step 1: Set normal background and text colors
Use bg-blue-600 for blue background and text-white for white text normally.
Step 2: Apply disabled styles with prefix
Use disabled:bg-gray-400 for gray background and disabled:text-gray-300 for lighter gray text when disabled.
Step 3: Verify order and prefixes
Classes must have disabled: prefix for disabled styles; base styles apply otherwise.
Final Answer:
bg-blue-600 disabled:bg-gray-400 disabled:text-gray-300 text-white -> Option B
Quick Check:
Disabled styles need disabled: prefix [OK]
Hint: Use disabled: prefix on all styles changing when disabled [OK]
Common Mistakes:
Missing disabled: prefix on text color
Placing disabled classes without prefix
Mixing order causing style override issues
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.