ajmajmajma
ajmajmajma

Reputation: 14216

How to change :before on hover state

I have some css I am working with, some links to be exact that have some :before on them for some aditional styling, I want the before to change background color when I hover on the .

Here's my poor attempt at it:

nav > li > a:hover a:before {
background-color: #fff

}

I just want to change the background color of the a:before when i hover over the a.

Thanks!!

Upvotes: 3

Views: 1904

Answers (2)

Hari kris
Hari kris

Reputation: 49

This may also work for you.

nav > li > a:hover::before { background-color: #fff; }

Upvotes: 1

joshhunt
joshhunt

Reputation: 5335

Try joining them together like this:

nav > li > a:hover:before {
    background-color: #fff;
}

Upvotes: 4

Related Questions