Title: Style navigation menu?
Last modified: August 21, 2016

---

# Style navigation menu?

 *  Resolved [Phoenix39](https://wordpress.org/support/users/phoenix39/)
 * (@phoenix39)
 * [13 years ago](https://wordpress.org/support/topic/style-navigation-menu/)
 * I’m finding the code examples a little confusing, so could anyone help me with
   adding my own css style to this menu?
 *     ```
       <div id="mainmenu">
       		<?php wp_nav_menu( array( 'theme_location' => 'mainmenu' ) ); ?>
       </div>
       ```
   
 * What should I add to the php code, and where does it end up in my style.css?
 * Help much appreciated.

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years ago](https://wordpress.org/support/topic/style-navigation-menu/#post-3868197)
 * You should be able to use the existing CSS to modify the styles – but you need
   to use a Child Theme or custom CSS option (if your theme has it) or custom CSS
   plugin.
 * What theme are you using?
 * Are you using a browser tool like Firebug to work with the CSS?
 *  Thread Starter [Phoenix39](https://wordpress.org/support/users/phoenix39/)
 * (@phoenix39)
 * [13 years ago](https://wordpress.org/support/topic/style-navigation-menu/#post-3868202)
 * I’ve made my own design from scratch, so most of the wordpress stuff is gone.
   My css file only contains the stuff I use (a pretty simple html design).
 * Is there an easy way to add a piece of code to the php menu thing, so it can 
   be styled in my style.css?
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years ago](https://wordpress.org/support/topic/style-navigation-menu/#post-3868207)
 * Have you read this:
 * [http://codex.wordpress.org/Function_Reference/wp_nav_menu](http://codex.wordpress.org/Function_Reference/wp_nav_menu)
 *  Thread Starter [Phoenix39](https://wordpress.org/support/users/phoenix39/)
 * (@phoenix39)
 * [13 years ago](https://wordpress.org/support/topic/style-navigation-menu/#post-3868211)
 * Yes, but with my very limited php knowledge it doesn’t help a lot.
 * I’ve finally been able to add ‘menu_class’ into the php code, so I was able to
   edit the ul part of the css. I still don’t know how to edit the li class and 
   link stuff though (like changing link colors)… how do I do that?
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years ago](https://wordpress.org/support/topic/style-navigation-menu/#post-3868212)
 * Start learning CSS, and use a browser tool like Firebug –
 * [http://www.w3schools.com/css/default.asp](http://www.w3schools.com/css/default.asp)
 * [http://getfirebug.com](http://getfirebug.com)
 * Beyond that, there’s no way for anyone to help with CSS without seeing the site
   live.
 *  Thread Starter [Phoenix39](https://wordpress.org/support/users/phoenix39/)
 * (@phoenix39)
 * [13 years ago](https://wordpress.org/support/topic/style-navigation-menu/#post-3868213)
 * I don’t think you get my problem.
 * I know CSS and HTML. It’s php I’m having problems with. So – my menu is just 
   a php code, that’s why I find it hard to manage. I just need to know what to 
   add into my php code to be able to edit the css parts.
 * for example, by adding ‘menu_class’ to my menu code I was easily able to edit
   the ul part of the css (while other parts like li and links were not possible
   to change).
 * So if anyone has some specific help regarding defining style in my php menu, 
   I would really appreciate it!
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years ago](https://wordpress.org/support/topic/style-navigation-menu/#post-3868215)
 * What specifically do you want to style that you cannot with the current HTML 
   structure?
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years ago](https://wordpress.org/support/topic/style-navigation-menu/#post-3868217)
 * You should be able to use the menu CSS selectors to target the li and link elements
   without changing any php. For example, something like –
 *     ```
       .my-menu ul li a {
          styles;
       }
       ```
   
 * will style the link.
 *  Thread Starter [Phoenix39](https://wordpress.org/support/users/phoenix39/)
 * (@phoenix39)
 * [13 years ago](https://wordpress.org/support/topic/style-navigation-menu/#post-3868220)
 * Just what I was looking for! Perfect! Thanks a lot.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Style navigation menu?’ is closed to new replies.

 * 9 replies
 * 3 participants
 * Last reply from: [Phoenix39](https://wordpress.org/support/users/phoenix39/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/style-navigation-menu/#post-3868220)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
