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.

Right-align menu button

  • Hi!

    I’m losing my hair over this very silly issue that seems to not be easy at all.

    Adding a button the menu is fine, but i’m unable to float it to the right side while having the rest items on the left.
    I’ve tried flexbox and the box method, but nothing seems to bite here.

    I see the parent UL is using flexbox, so I tried the recommended margin-left: auto; on the last li item, and that doesn’t work either.

    What am I missing? I’ve done this so many times but i’m falling flat here.

    https://docs.generatepress.com/article/adding-buttons-navigation/

    /* == MENU BUTTON .nav-button ======================== */ 
    	.main-navigation .main-nav ul li.nav-button {
    		margin-left: auto;
    	}
    
        .main-navigation .main-nav ul li.nav-button a {
            line-height: 35px;
            color: var(--contrast);
    	border-radius: 5px;
    	border-bottom-left-radius: 0px;
    	background-color: var(--base-3);
    	transition: all 0.2s;
    	&:hover {
    		background: var(--contrast);
    		color: var(--base-3);
    	}
        }
  • Hi there,

    add this to your CSS:

    .main-navigation .main-nav {
        flex-grow: 1;
    }
  • Brilliant, thanks for saving my hair (the little I have left!) 😀

  • Haha 🙂
    Glad to be of help

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