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.

How to center this block while keeping max width

  • I am having trouble figuring out how to center this block (the one that starts with “why choose fee-only”) – while still keeping a 1000 px max width. When i put block alignment to center, it removes the max width for some reason and it stretches across the screen.

  • Hi there,

    Have you added the alignwide class to the container? If so, remove that class first.

    Then select the inner container that wraps the heading and text, set the margin-left and margin-right to auto.

  • hey sorry I tried the margin-left and margin-right suggested here but still can’t get it to work – i don’t see any alignwide class, or know how to remove it exactly if there is one – can you please give some other suggestions or specifics on how to fix this please?

  • The alignwide class needs to be removed for the setting to work.

    Click on the container, and in the Block settings on the right-hand side, navigate to the Advanced options. Check the Additional CSS Class(es) field to see if the class alignwide is added there.

  • There isn’t anything in the Additional CSS Class, I checked all of the containers. So the problem is, there is a layout Element that had full width enabled here, that was built into the Pattern Library I used. I don’t want to remove it because it will break a lot of the page.

    Is there any way that I can override that full-width for this container? I’m not sure how the other containers below are able to override this full width enablement.

  • In that case, try using CSS to override the full-width layout on that container:

    .gb-container-6be978b8 {
        max-width: 1100px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
  • this worked, thank you

  • You’re welcome

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