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


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:

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)


Hariprasad Vijayan answers:


Try this,

#nav .other a {
color: #fff;


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!


Ben Tupper answers:

Add this to your CSS stylesheet:

/*Make last link in main menu white*/ a {
color: #fff;

/*Make last link in main menu reverse colors when hovered on*/ a: hover {
color: #000;