HTML & CSS · Junior · Question 49 of 75
How do you change a button's background on hover in Tailwind?
- ✓Correct answer:
bg-blue-500 hover:bg-blue-600 - 2
bg-blue-500 :hover-bg-blue-600 - 3
bg-blue-500 on-hover:bg-blue-600
Explanation
States in Tailwind are set with variant prefixes: hover:, focus:, focus-visible:, active:, disabled: and so on. Prefixes can be combined: md:hover:bg-blue-600. Tailwind has no :hover- or on-hover: syntax.