How to Highlight a Certain Menu Item?

Sometimes there is a need to highlight a particular menu item. You can highlight a menu by adding a different background color, text color etc to the particular menu item using custom CSS. To apply custom CSS you need to add CSS class for the menu. Below are the steps to add a CSS class to the menu and highlight it using a custom CSS.

Step 1 – From the WordPress dashboard navigate to Appearance > Menus.
Step 2 – Click on Screen Options and tick the CSS Classes checkbox.
Step 3 – Click on the menu item that needs to be highlighted.
Step 4 – Add CSS class to the menu item and save the changes in the menu. 

Once the CSS class is added you can add CSS with respect to this class. Make sure you add a dot (.) before the CSS class while writing the CSS code. Below is a sample CSS code that you can try. Note the CSS class used is menu-highlight

Below CSS will add a simple button to menu item:

 background: #d3d3d3;
 border-radius: 35px;
 padding: 0px 20px;
 line-height: 50px;

For the above CSS, the highlighted menu will look as shown in the screenshot below –
Below CSS will add the outlined button to menu item: 

.menu-highlight {
color: #ffffff;
background: transparent;
border-color: #1172c4;
border-style: solid;
border-width: 2px;
border-radius: 50px;
padding: 0px 10px;
transition: all 0.2s linear;

.menu-highlight a {

.menu-highlight:hover {
color: #ffffff;
background: #1172c4;
border-color: #1172c4;
} a {

.menu-highlight:active {
border-radius: 22px;

For the above CSS, the highlighted menu will look as shown in the screenshot below –

Additional Notes:

  • This CSS can be pasted in Customizer ▸ Additional CSS as explained here.
  • You can tweak the CSS code to change the colors and look of the highlighted menu item.
Not the solution you are looking for? Check other articles, or open a support ticket.