Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

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

    Laurie BarthLaurie Barth
    cssCSS

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

    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Discuss

    Discuss

    Transcript

    Transcript

    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.