WordPress database error: [Table 'shark_suretriggers_webhook_requests' already exists]
CREATE TABLE shark_suretriggers_webhook_requests ( id mediumint(9) NOT NULL AUTO_INCREMENT, request_method varchar(255) NULL, request_url varchar(255) NOT NULL, request_data longtext NOT NULL, response_code int(3) NOT NULL, status varchar(20) NOT NULL, error_info varchar(255) NOT NULL, retry_attempts int(3) DEFAULT 0, processed_at datetime NULL, created_at datetime, updated_at datetime ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id) ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci

How to Highlight a Certain Menu Item?
|
↳ See all 14 articles
/ Documentation /Custom Code Snippets/Custom CSS/ How to Highlight a Certain Menu Item?

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.

Menu Highlight 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 create a simple button out of the menu item:

.menu-highlight
{
 background: #d3d3d3;
 border-radius: 35px;
 padding: 0px 20px;
 line-height: 50px !important;
 margin: auto;
}
Menu Highlight CSS Output 1

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

.menu-highlight a{
color: #ffffff !important;
background: transparent;
border-color: #1172c4;
border-style: solid;
border-width: 2px;
border-radius: 50px;
padding: 0px 10px !important;
transition: all 0.2s linear;
line-height:45px;
}
.menu-highlight a{
color:#1172c4 !important;
}
.menu-highlight a:hover {
color: #ffffff !important;
background: #1172c4;
border-color: #1172c4;
}
li.menu-highlight:hover a{
color:#ffffff !important;
}
.menu-highlight:active {
border-radius: 22px;
}

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

Menu Highlight CSS Output 2

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.
Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page
Scroll to Top