0
votes

I coded background image and color for the sidebar category in wordpress.

I set background image for sub-menu for the category

.sub-menu li.menu-item-object-category {
    background: url("http://www.example.com/dev/123/wp-content/uploads/2014/04/list_style.png") no-repeat scroll left center transparent;
}

here i set active current menu item highlight color as bakground

.menu-item-object-category.current-menu-item {
    background: none repeat scroll 0% 0% rgb(234, 234, 234);
}

Here both are not supported same time if the background image removed means background color activate, if background color removed means background color activate. I want to activate both.

Help to solve this.

1
would be good if you can make a fiddle - Kheema Pandey
shouldn't you use .sub-menu instead of .menu-item-object-category check the Demo. jsbin.com/pefodoti/1/edit - Kheema Pandey
Thanks sir, separately i set .sub-menu li.menu-item-object-category for background image and background color now it is working - Balaji
glad your problem is solved now. - Kheema Pandey

1 Answers

0
votes

If I am understanding you correctly, you are overwriting the background image with a colour and vice versa.

Try instead:

.sub-menu li.menu-item-object-category {
    background-image: url("http://www.example.com/dev/123/wp-content/uploads/2014/04/list_style.png") no-repeat scroll left center transparent;
}

.menu-item-object-category.current-menu-item {
    background-color: none repeat scroll 0% 0% rgb(234, 234, 234);
}