I have a compact header on my community that must have white background and black text but when I hover on my navigation menu items the hover convertex text to white and the menu item convert color to the same color of the background.

I tried to change the css from the edit css option of the communities but it seems that I cant because the hover have the '!important;'

enter image description here

This is my custom css:

enter image description here

1 Answer 1


As a best practice, you want to avoid this approach. Instead consider creating a custom theme layout for your community and creating your own header component.


Let's say that you do manage to override the CSS using !important (which itself is not considered a best practice). In a future release, Salesforce may include changes in the selectors which you use to override the CSS. your rule then becomes obsolete, and you are back to trying to figure out how to override it.

Hope this helps clarify why you should not use this approach.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .