WordPress.org

Ready to get started?Download WordPress

Forums

How to Add Custom Class to Individual li Items in (wp_nav_menu) (2 posts)

  1. Shahzad
    Member
    Posted 1 year ago #

    Hi there,
    I want to add a css class to the first menu item in wp_nav_menu – as the padding/border for this item needed to be different than the other menu items.
    Any suggestion please! I am already read this function on wordpress.
    http://codex.wordpress.org/Function_Reference/wp_nav_menu
    but nothing do better and not able to apply a css class in li item... I am worried about this...

  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Use a tool such as Firebug, Chrome Inspect Element, or IE9+ F12 Developer Tools to inspect the menu item's HTML output and CSS...you should see a unique style that will be in the form of:

    <li id=menu-item-number .....

    Create a style for this unique id.

Topic Closed

This topic has been closed to new replies.

About this Topic