Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

css classes for one menu item, swapping colors around WordPress

  • SOLVED

Hi all,


I would like to change the colors of a menu item using the style sheet and the css classes option.


this is the website: http://raphael-levy.com

the very last menu item I would like it to be white text and black background. I created a custom css for that menu item:

.other {
background: none;
font-size: 11px;
background: -moz-linear-gradient(top,#000000,#000000);
background: -o-linear-gradient(top,#000000,#000000);
border: 1px solid #ffffff;
color: #ffffff;
text-shadow: 0 0 0 #ffffff;
}

but obviously I don't know how to code so that is not working, anyone could fix that for me?

Thanks a lot!

Answers (3)

2015-01-10

Hariprasad Vijayan answers:

Hi,

Try this,

#nav .other a {
color: #fff;
}

2015-01-10

Dbranes answers:

Hi, not sure I fully understand, but you could try for example:


#nav .other a {
background: black !important;
color: white !important;
}

#nav .other:hover a {
background: white !important;
color: black !important;
}


artaudlemomo comments:

thanks Dbranes it worked like a charm!

2015-01-10

Ben Tupper answers:

Add this to your CSS stylesheet:

/*Make last link in main menu white*/
li.other.menu-item.menu-item-type-taxonomy.menu-item-object-category.menu-item-4328 a {
color: #fff;
}

/*Make last link in main menu reverse colors when hovered on*/
li.other.menu-item.menu-item-type-taxonomy.menu-item-object-category.menu-item-4328 a: hover {
color: #000;
}