Home:ALL Converter>Change color when hovering over li

Change color when hovering over li

Ask Time:2019-01-24T05:43:44         Author:Daan Seuntjens

Json Formatter

I'm programming a simple wordpress page and want to change the background color of the menu bar (on the top right) when hovering over it. It's on this website: https://www.happylogo.be/. I normally just do this with 'add additional css' which just is a css file. The weird thing is that I beleive my selector code is right because when I add 'visibility:hidden;' It rapidly disappears and reappears again when hovering over the li items.

The css code I use now:

#menu-primary-coach li:hover{
   /*#menu-primary-coach is the id of the lu*/
   background-color: #c7143a !important;
}

But it doesn't work. How can I change the background color when hovering over the menu items?

Author:Daan Seuntjens,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/54336155/change-color-when-hovering-over-li
jordanmannfeld :

I noticed the <a>tag inside of your <li> is actually overriding the hover state with black. \n\n#primary-nav ul li:hover > a, #sticky_menu li:hover > a {\n background-color: #000000;\n}\n\n\nYou can remove this style or also set the hover state of the <a> to your desired color.",
2019-01-23T21:53:08
yy