Pseudo Classes

You may have noticed that sometimes the style of an element changes based on its state. Most commonly, an animation is triggered when the mouse hovers over an element. This can be achieved using pseudo classes, specifically the :hover pseudo class.

A pseudo class can be combined with any selector. For example:

a:hover {
    background-color: blue;
}

With this code, whenever we hover over an a element (link), its background color will change to blue.

Instructions

For p elements on hover, create a rule with the following declaration color: red;.

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

7/12

Pseudo Classes | Start Coder