Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form
Flexbox, or Flexible Box Layout, is a powerful new CSS layout mode that gives designers an efficient and simple way to lay out, align, and distribute elements in a container. It solves many layout problems that designers have been struggling to solve for a very long time—such as vertical centering, among many others.
Flexbox has a variety of settings, some of which are applied to the flex parent container (“flex container”), while others are set on its flex children (“flex items”).
Items inside a flex container can be laid out horizontally or vertically, aligned and distributed in various ways, and can be stretched or shrunk to fill the available empty space. All these options let you easily create responsive layouts.
Note: Flexbox shines when you’re creating layouts for specific subsections of your website, but can also be used for high-level page layouts.
To start using flexbox, you just need to select any block and give it the Display Setting Flex. This flex container should have one or more elements inside.
1. Add a div block or a section to the canvas and give it a class.

2. To see flexbox in action, the div block or section needs to have some child elements. Add 3 div blocks inside your container element.

3. Now it’s time to turn the parent element to a flex container. Select it and set its Display Setting to Flex. As you can see, the items inside the container are now laid out horizontally.

By default, the Direction of a flex container is set to Row, so the child elements display horizontally. You can switch the layout to vertical by setting the Direction to Column.
Whichever direction you set on your flex container is referred to as its “main” direction, while the other direction (the one you didn’t choose) becomes its “cross” direction. So if you’re using the default settings, the main direction is horizontal, while the cross direction is vertical.

In addition to changing the direction, flexbox also lets you reverse the layout. When you check the Reverse Layout box, children of a flex container will be laid out right-to-left (if horizontal) or bottom-to-top (if vertical). This can come in handy if you want to reverse the layout on smaller screens.
Flexbox’s settings give you two rows of alignment options. Regardless of whether the direction is set to Row or Column, the first row of settings defines the horizontal alignment of flex items, while the second row defines their vertical alignment.
Alignment in horizontal layout:

Alignment in vertical layout:

Let’s see how the various alignment settings work in a horizontal flex container.
Here are your horizontal alignment options for items inside a flex container:

Here are your vertical alignment options for items in a flex container:

By default, a flex container’s children will always try to fit on a single line.
You can change that by checking the Wrap Children checkbox, which allows children to wrap to a new line if necessary.

Note: this setting won’t have any effect if you haven’t set a minimum size for flex children.
Here are your options for aligning multiple rows of content within a flex container:

Note: For these options to work, you’ll need to make the flex container’s height (or width, if Direction is set to Column) bigger than the content.
When an element is placed inside a flex container, it automatically becomes a flex item, and gets its own settings. These settings control sizing, alignment, and display order.

Flex items can alter their width or height (depending on the container’s layout direction) to fill available space.
Webflow’s Flex Item Settings offer the top 3 presets for flex sizing, covering the most common effects, but also allow for fine-grained control over individual flex sizing properties.
Note that each flex item can have its own settings, allowing for a wide array of design options.

1. Shrink if needed: sizes the item based on its width/height or its content. When you turn this on, the item won’t grow larger than it needs to, but may shrink to its minimum size to prevent overflow.

2. Expand: allows the item to expand to fill all available space inside its parent. If you set this on all items in a flex container, they’ll expand to take up equal amounts of empty space.

3. Don’t shrink: sizes the item based on its width/height or its content, but doesn’t allow it to shrink, even if that will cause overflow.

Presets in action:

To take full control over the sizing of a flex item, click on the Settings icon next to the Sizing presets.

The Advanced Sizing area gives you access to 3 properties that allow fine-grained control over how the item is sized:
Note that these advanced sizing properties will override the Sizing preset.
To help you better understand how these properties work together, here are some possible values and their output:
Flex items can have their own alignment settings, which override the default alignment set by their parent flex container.

The “Aligning flex items along the cross axis” section explains these alignment options.
By default, flex items display in the same order as they are placed in the source code.

To override this, you can use the Order setting, which gives you 3 preset options:
To use this option on a specific item, you’ll need to give it a unique class, then apply the Order.
You can also set different Order options for different screen sizes, which may come in handy when you want smartphone users to see different content than those on desktops.
When you want to control the display order of several flex items, you can use the Custom Order setting.
Just click the Settings icon next to Order presets to define a Custom Order.

Custom order can be defined as a number, which specifies the order in which the flex item appears inside a flex container.

Note that flex items with the same Order Number will be laid out in the order they are placed in the source document
To see how you can use flexbox to create real-world web design patterns, check out Webflow’s visual flexbox builder, which has a variety of examples of flexbox in action. You can open the page in the Webflow Designer to inspect the settings applied to each example and get a better understanding of how they are designed using flexbox.
You should also play through Learn Flexbox with Webflow, a fun, 28-level interactive game that teaches you flexbox’s core principles.
And be sure to check out our flexbox layout tutorials, which showcase a dozen different ways you can use flexbox for your different layouts.
Oops! Something went wrong while submitting the form
Oops! Something went wrong while submitting the form
Oops! Something went wrong while submitting the form