In this article, we will explain how we can customize the appearance of a menu item using the custom CSS code.
Please follow these steps:
1. First, we should add a custom class to the menu item. Please go to "WordPress dashboard >> appearance >> menus"
2. Then click on “Screen Options” in the top right corner of the browser. Now select “CSS Classes” option and this option will be available for each menu item
3. Next, click on your desired menu item and you will see that CSS classes are added to options there. Add a class to the menu item and save your modifications.
4. Now that menu item has an extra CSS class and you can use that class for customization.
So you can add the css codes which you want into the site setting >> general >> custom css
Here are some examples of customization.let's assume that the custom class name is "customize-me".
Hiding that menu item:
- .customize-me{display:none;}
Changing font size and color for that menu item:
- .customize-me a {
- font-size:20px !important;
- color: red !important;
- }