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.

Center button text

  • This page has a two-column block with a Generate Blocks button in each column. The buttons render correctly but the button text does not center, even though the text is configured to center. I would like to keep the GB buttons if I can get the text centered. If I can’t get the text centered I’ll just create some CSS buttons and use Custom HTML instead of the GB buttons.

    Thanks for your help.

    https://acousticsspecialty.com

    Here is the left button CSS from the website. Curiously if display: inline-flex; is dectivated the text centers but the button loses other formatting.

    .gb-text-b9239d82 {
      align-items: center;
      background-color: rgba(255,255,255,0.15);
      border-bottom-style: solid;
      border-bottom-width: 2px;
      border-left-style: solid;
      border-left-width: 2px;
      border-right-style: solid;
      border-right-width: 2px;
      border-top-style: solid;
      border-top-width: 2px;
      box-shadow: 3px 3px 3px 4px rgba(0,0,0,0.1);
      color: #ffffff;
      display: inline-flex;
      font-size: 20px;
      font-weight: 500;
      height: 42px;
      letter-spacing: 1px;
      line-height: 1.2em;
      position: relative;
      text-decoration: none;
      transform-origin: center,50%;
      width: 240px;
      border-radius: 20px;
      padding: 1rem 2rem;
    }
  • Hi Mike,

    To fix that, simply select the Button block, then under Layout > Alignment, set Justify Content to Center.

  • Thanks! I didn’t know about the button formatting controls. It looks great now.

    Thanks again,
    Mike

  • You’re welcome! 🙂

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