Katallone Katallone - 7 months ago 33
HTML Question

CSS. :hover not working on nav>li

I'm stuck with this for some hours, can't figure out why it doesn't do anything on hover. This is happens only on the li elements.

Here is my code (nav bar) : https://jsfiddle.net/5tobthjx/2/
My css code starts at the very bottom (//My-css).

As you see I have :

li:hover {
border: 2px-solid-black;
}


Why doesn't it do anything?

I even put a class on the lis : '.li'

I mean:

.li:hover {
border: 2px-solid-black;
}

Answer

You got the wrong syntax. You have this:

li:hover {
    border: 2px-solid-black;
}

You want this:

li:hover {
    border: 2px solid black;
}

It works for me