How do I center a third party affiliate code widget in my Webflow page?

TL;DR
  • Add the Embed element on the page and paste the affiliate code.
  • Use Flexbox on the parent container (section or div) to center the widget by setting display to Flex and adjusting justify and align settings to center.
  • Adjust the Embed element size with width and height properties using percentages or pixels.
  • Preview and publish the page after ensuring the widget is centered correctly.

Centering a third-party affiliate code widget on a Webflow page involves a few straightforward steps to ensure the widget aligns perfectly in your design. 

1. Add the Embed Element

  • Drag the Embed element from the components panel into your desired location on the page.
  • Paste the affiliate code into the Embed element where the HTML code can be added.

2. Use Flexbox for Centering

  • Select the parent container of the Embed element, such as a section or a div block, and ensure it is currently selected.
  • In the style panel, set the Display setting to Flex.
  • Change the flex direction to Vertical or Horizontal, depending on your layout needs.
  • Set Justify and Align: Make both Justify and Align selections center. This will center the widget horizontally and vertically within the parent element.

3. Adjust Embed Element Size

  • Ensure the Embed element is appropriately sized to fit the widget by setting width and height properties if necessary.
  • Use percentages or pixels: For responsive design, consider using percentage values to maintain proportions across different devices.

4. Preview and Publish

  • Preview the page to make sure the widget is centered as expected.
  • Make necessary adjustments in the flex settings or sizes if alignment seems off.
  • Publish the changes to your website once everything looks aligned.

Summary

To center a third-party affiliate code widget in Webflow, place the code in an Embed element and use Flexbox on the parent container to align it horizontally and vertically. Adjust the widget’s size and preview changes to ensure correct alignment before publishing.

Rate this answer

Other Webflow Questions