WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Defining first/last list item in wp_nav_menu? (3 posts)

  1. SpankMarvin
    Member
    Posted 4 years ago #

    Hi there

    I am using the wp_nav_menu function to generate my navigation. I will be using specific borders to go between the nav items, and so I need a convient way to define the first or the last list item, so that this can NOT have the border.

    E.g. all list items have a left-hand border, so the first item would need to be told not to have the border...

    I can get this working by directly referring to the id of the list item in question in my stylesheet, but I'd quite like to get this more portable. I could create a variant of the function, I suppose, and tweak that, but am wondering if there's anything slightly less overkill I can do to solidly number the ids of these list items.

    Any advice would be appreciated.

    Thanks!

    John

  2. SpankMarvin
    Member
    Posted 4 years ago #

    Never mind, I just applied a specific style to ul li:first-child to remove the left-hand border. I can live without IE6 support on this feature.

    J

  3. saulyz
    Member
    Posted 3 years ago #

    I was also looking for any solution for the same reason. wp_nav_menu looked limited in this point. This simple CSS aproach looks the best.

Topic Closed

This topic has been closed to new replies.

About this Topic