Button Alignment

These options require GenerateBlocks 1.7.

Prior to GenerateBlocks 1.7, adding a Buttons block to the page added two blocks, the Button Container and individual Button block inside of it. With the new Container block and the addition of the flexbox options, it made perfect sense to deprecate the “Buttons” block.

This change provides users with more control over their designs and allows for greater creativity by revealing more possibilities.

Button Alignment Examples

Multiple button blocks in one row

This is the default behaviour of a Button block as its Display attribute is set to inline-flex.

Button 1 Button 2 Button 3

Multiple button blocks in one row with Alignment

To set alignments for multiple Button blocks in one row:

Button 1 Button 2 Button 3
Button 1 Button 2 Button 3
Button 1 Button 2 Button 3

1. Wrap the Button blocks with a Container block.

2. Select the Container block and choose the following settings under the Layout component:

  • Display: flex
  • Column gap: 10px (optional: to add space between Button blocks)

3. Use the Justify Content options to set the desired alignment.

Multiple button blocks fill one row

To make multiple Button blocks in one row and fill the entire space:

Button 1 Button 2 Button 3

1. Wrap the Button blocks with a Container block.

2. Select the Container block and choose the following settings under the Layout component:

  • Display: flex
  • Column gap: 10px (optional: to add space between Button blocks)

3. Select the Button blocks and use the following setting under Flex Child:

  • Flex grow: 1

stack full-width button blocks

To stack the Button blocks vertically and make them full width:

Button 1: justify content set to flex-start Button 2: justify content set to center Button 3: justify content set to flex-end

Select the Button blocks and choose the following settings under the Layout component:

  • Display: flex
  • Justify content: center/flex-start/flex-end (optional: to position the Button content)

stack non-full-width button blocks

To stack the Button blocks vertically and do NOT make them full width:

Button 1 Button 2 Button 3

1. Wrap the Button blocks with a Container block.

2. Select the Container block and choose the following settings under the Layout component:

  • Display: flex
  • Direction: column
  • Row gap: 10px (optional: to add space between Button blocks)

3. Multi-select the Button blocks and and choose the following settings under the Spacing component:

  • Margin-left: auto
  • Margin-right: auto

Note: when both margin left& right is set to auto, it horizontally centers the Button block.

To align the Button to the left, set only the ‘margin-right’ property to auto.

To align the Button to the right, set only the ‘margin-left’ property to auto.