Conditionally Apply Style on Hover with the CSS Hover Pseudo-class

Laurie Barth
InstructorLaurie Barth
Share this video with your friends

Social Share Links

Send Tweet

Use the hover pseudo-class to apply conditional styling when a user interacts with an element but has not yet activated it.

Instructor: [0:01] Start with a simple selector. We're adding the rule background color and setting it to red. If we add a colon and the hover pseudo class, that rule will only apply when a mouse is hovered over the button.