WordPress.org

Support

Support » Themes and Templates » Styling the nav (wp_nav_menu) with classes

Styling the nav (wp_nav_menu) with classes

  • all-nighter
    Member

    @all-nighter

    I would like to modify the styling of specific list items (or categories) in my nav. I know how to modify all of the list-items so that they all look a particular way but now I want to modify each one individually so that they will each have a different color on their hover states.

    http://www.all-nighter.com

    This is what I have right now. I’m new to wordpress and would appreciate any help. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Equal Web Creative
    Member

    @equalwebcreative

    I cannot access the site at the moment as there is a PHP error

    if your theme uses wp_nav_menu to display menus (ie, you use the menu builder to create a menu) the each item gets an ID/class assigned I believe

    each item looks like this when I hit view->source

    <li id=”menu-item-1016″ class=”menu-item menu-item-type-post_type menu-item-1016″>Forum

    so adding that to your css would work, since you have an ID and a class, you could hit either
    #menu-item-1016
    or
    .menu-item-1016

    would work

    so for hover on that particular example:
    .menu-item-1016 a:hover {
    background: #cc99aa;
    color: #fff;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Styling the nav (wp_nav_menu) with classes’ is closed to new replies.