How Do I Find the CSS Class of a Menu in WordPress?

When designing a WordPress site, one of the many things you need to worry about is how to style different elements on the page, like menus, posts, and other elements. You can use a variety of methods to find the CSS class of a menu in WordPress, but the simplest and most reliable way is to use the codex.

To find the CSS class for a menu, first you need to find the HTML code for the menu. To do this, open the menu in a text editor and search for the

  • tag that contains the menu items.

    Within the

  • tag, you will find the tag that contains the menu items. The tag will have a href attribute, which you can use to find the source code for the menu. The href attribute will contain the URL for the menu, like this:.

    Menu Item 1

    The URL for the first menu item in the example above is http://example.php. The href attribute for the tag will contain the same URL, but with a .

    css extension added to the end. To find the CSS class for the first menu item in the example, you would use the code .css.menu-item1.