WordPress.org

Support

Support » Themes and Templates » Giving width to nav buttons in fixed width menu

Giving width to nav buttons in fixed width menu

  • I am building a site into WP that has a fixed width menu and having a lot of issues with getting the sizing of it to play nice with WP.

    Is the best way to handle this to apply some custom CSS for the specific menu ID that WP has automatically assigned to each button? Can these ID’s be trusted? Like, do they ever change?

    Is there a better way to handle a fixed with menu?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator Andrew Nevins

    @anevins

    Forum moderator

    Can you give an example of these IDs WordPress supplies?

    menu-item-801
    menu-item-802
    menu-item-805

    etc..

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    They are reliable unless the page is deleted.

    custom css would still be a better option u could do something like

    #menu_id > ul li
    and if you know to use

    first-child::
    last-child::
    elements

    Thanks Andrew.

    Robin….. that would cause issues if the buttons were moved around.

    buttons were moved around ?

    Yes, if the buttons are moved from for example the first spot (first child) to the 3rd child.

    ah
    the first child means if u have menu like
    a
    b
    c

    no matter where u move there always be a first child and always be a last child no matter where you move

    a is first child
    and c is last child
    yup unless you only have 1 menu item

    and if you even added 10 menu items the 10th item would automatically be considered last child

    Yeah I know that, but what I mean is if you set the width of say the first-child (Example 1) to 100px and the 3rd child (Example 2) to 150px and then moved Example 1 to be the third child and Example 1 to be the first child, then that would mean Example 2 now would have a width of 100px and Example 1 would have a width of 150px. 😉

    so you have
    home
    about
    contact
    so you would want to move them to
    contact
    about
    home

    any how not sure how your menu are structured i just said in ideal conditions using li and first child last child is a better option

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Giving width to nav buttons in fixed width menu’ is closed to new replies.
Skip to toolbar