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 button center?

  • Hi, support team.

    im using 2 buttons from my post meta’s in my posts.

    There is always a button, but the other button is not in some articles. How can I center the button when there is only one button?

  • Hi there,

    how are the buttons being added ? are they using dynamic data and if os what type

  • Hi David, im adding buttons dynamic data: https://prnt.sc/aL7XRkAhJLoa

  • OK. so instead of using a Grid Block to lay out the buttons.
    Use a Buttons Container see here:

    https://docs.generateblocks.com/article/button-overview/

    Then in the Buttons Container > Layout , you can
    1. set the Column Gap to add space between them.
    2. set the Justififction to Center.

    Then select the Button blocks and in their Layout -> Flex Child set the Grow to 1
    The buttins will then share equal space.

    Now if the dynamic data post meta doesn’t exist the button wont be printed and therefore take up no space, and the remaining buttons will fill that space.

  • Thank you David! 🙂

  • You’re welcome

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