Changing one menu item colour
-
Hello,
I need help with changing the colour of one menu item, to make it noticeable.
My website is http://en.initiative.bg/, menu item COMING CONFERENCE, my theme is Avonne.
I need the font of it to be red when inactive, and the background colour to be red when active.
Please, explain it for a complete novice. Thank you in advance! 🙂
-
li.menu-item-482 { background-color: red; }That CSS rule should do it.
You should either put that in a child theme style.css file or maybe use simple custom css plugin to add the style. Your theme may have an option for custom css.
The list item
<li>has aclass="menu-item-482"and the selectorli.menu-itme-482in the CSS rule targets only that.Hi lizaaabg,
Try out this code in your custom CSS editor or child theme’s stylesheet:
#menu-item-482 > a { color: red; } .menu-item-482.current-menu-item, .menu-item-482:hover, .menu-item-482:focus, .menu-item-482:active { background: red; } .menu-item-482.current-menu-item > a, .menu-item-482:hover > a, .menu-item-482:focus > a, .menu-item-482:active > a { color: #fff; }I’m not sure what you meant with active, but the options above should cover it. Because the code above is specific to that menu item, if you change anything in your menu, make sure to check the class of that specific menu item again. At the moment it’s .menu-item-482, but this may change if you modify your menu.
I hope this helps 🙂
Thank you both for your answers! 🙂
martcol solution worked like a charm and simplified what I needed by making the whole item red at all times.
Maria Antonietta Perna I tried your’s too but it was red only when you click on it, it wasn’t noticeable in the home page view.
But again I thank you both for you helpful and prompt answers! 🙂
The topic ‘Changing one menu item colour’ is closed to new replies.