Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress

Dennis de Vries
Dennis de Vries
9,440 Points

How style a custom menu with css?

So I've just learned to add custom menu's to wherever I like in the site, using the 'register_nav_menus' function and adding the 'wp_nav_menu' to any part of the site.

Cool! This adds a pretty boring old unordered list to, in the case of this video, the footer of the template. Now I'm wondering, how would one go about and style this. How do you give this custom menu an id, so you can edit the css of that particular menu?

In the previous video Zac does show how to style a custom widget area and I followed those instructions on the custom menu, but that did not work. Any other ideas?

Thanks!

1 Answer

Daniel Lucas
Daniel Lucas
3,604 Points

If you inspect the menu, they should already have classes, and ID's for you to style.

Right Click > Inspect Element

Dennis de Vries
Dennis de Vries
9,440 Points

It does indeed, thnx.

Follow up question: Is it possible to add a class or id to the menu through php (similar as with widget area's)?