Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Primary Menu Spacing in New Navigation Block

  • Noticed there is a default spacing in between primary menu items that I cannot seem to find. This works to adjust menu item spacing:

    .gb-menu .gb-menu-link {
      padding-left: 0;
      padding-right: 0;
    }
    
    .gb-menu > li {
      margin-right: 18px;
    }
    .gb-menu > li:last-child {
      margin-right: 0;
    }

    Is there a way to control this inside the new Navigation Block somehow? I would like to tighten spacing between each primary menu item.

    Thanks!

  • Hi there,

    Can you link me to your site where I can see the menu?

    I don’t think CSS is needed. You should be able to use the block settings to control the spacing.

  • Added login creds to staging site. It is using the new GB library Site Header 9. Let me know which block controls the spacing between the primary nav items. Thanks!

  • Hi there,

    Select the Menu Item block, then click Manage Selector and choose the Link selector.

    That will create an equivalent selector for your first CSS example, and you can adjust the padding values from there.

    If you’d like to target the li element and the last child specifically, you can create a custom selector for both. Select the Menu block, click Manage Selector, create a new selector, and add the following in the selector field:

    > li and > li:last-child

  • Hi Akvind, that worked, thank you! Please remove the link to the screen grab as it’s a dev site. Thanks again!

  • You’re welcome! 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.