Harvey Harvey - 6 months ago 29
CSS Question

CSS to change set background of active nav menu page

I have this website of http://camerabeanbags.co.uk/test
and on the top Nav Menu you can see when you hover over the text on the menu a grey background shows behind the text.

What CSS code can i use to have the grey background show behind the active page? So if i am on the Home page then a grey background shows behind the home page text on the menu?



Answer Source

No need to add background or anything to your code.

li.current-menu-item a:before {
    transform: scaleX(1);

This would trigger default style that you have for hover state.