To place two div boxes side by side in Webflow, especially when one is a Flexbox Div and the other may or may not be, you can achieve this without coding using layout settings in the Webflow Designer.
1. Use a Parent Flex Container with Horizontal Direction
- Create a Parent Div (Container) and name it something like
Wrapper
. - In the Style panel, set the Display to Flex.
- Set the Direction to Horizontal (Row). This arranges its child elements side by side.
- Now add two child Div Blocks inside this parent (
Div A
and Div B
), which will sit next to each other horizontally.
2. Make One or Both Child Divs Flex Containers
- Select either
Div A
or Div B
(or both). - In each selected div's Style panel, set Display to Flex if you want them to control their own internal layout (e.g., align items or distribute internal content).
- The internal use of Flexbox in the child divs does not interfere with the parent Flexbox’s horizontal layout.
3. Adjust Widths Appropriately
- You can control the visual size of
Div A
and Div B
using: - Fixed width (e.g., 300px)
- Percentage width (e.g., 50% each)
- Flex grow/shrink values by selecting "Grow if possible" in the Flex Child settings for more flexible layouts
4. Optional Styling Enhancements
- Apply Margins or Padding to space the divs as needed.
- Set Align Items or Justify Content in the parent flex container to further control vertical or horizontal alignment.
Summary
To place two divs side-by-side in Webflow—where one is a Flexbox—you simply wrap them in a parent Flexbox container set to horizontal. This is fully achievable with Webflow’s visual tools and does not require any coding. Each child div can also be a Flexbox container itself, independently controlling its inner layout.