База знаний конструктора сайтов Taptop

Flex Layout

Содержание
Добавьте заголовки в ваш документ, чтобы сгенерировать содержание.

Flex mode can be set in Auto Layout by clicking on the icon in the Display setting.

BlockNote image

In this mode, you can flexibly control the layout of child elements inside their parent flex container. In Flex mode, you can put child elements in a row or a column, align horizontally and vertically relative to each other, setup wrapping, and adjust spaces between elements.

You can position child elements in a container with two types of settings :

Auto Layout is applied to a parent element (flex container) to customize the layout of its child elements

Child Layout – is applied to a child element to setup its custom position

Flex options

Flex is set on a parent element but affects child elements.

Properties :

1. Direction

Child elements are positioned horizontally, vertically (and vice versa) within a flex container. The direction defines the main axis along which the child elements are aligned.

BlockNote image

Row (horizontally)  - All elements are arranged in a row from left to right.

BlockNote image

Column (vertically) - All elements are arranged in a column from top to bottom.

BlockNote image

Row-reverse (horizontally) - All elements are arranged in a row from right to left.

BlockNote image

Column-reverse (vertically) - All elements are arranged in a column from bottom to top.

BlockNote image

2. Justify

With Justify option you can align child elements within a flex container along the main axis. If horizontal Direction is selected, this will align the elements along the horizontal axis. If vertical Direction is selected, this will align the elements along the vertical axis.

BlockNote image

Start - Elements are aligned from the beginning of the axis.

BlockNote image

Center - Elements are centered.

BlockNote image

End - Elements are aligned from the end of the axis.

BlockNote image

Space between - Elements are distributed evenly throughout the container. The first element is at the beginning of the container and the last one is at the end.

BlockNote image

Space around - Elements are distributed evenly throughout the container with equal spacing around them. Note that the spacings are not visually equal as all elements have the same margins on both sides.

BlockNote image

Space evenly - Elements are distributed so as to have equal spacing between any two elements (and distance from one edge to another).

BlockNote image

3. Align

With Align option you can align child elements within a flex container along the perpendicular axis. If horizontal Direction is selected, this will align the elements along the vertical axis. If vertical Direction is selected, this will align the elements along the horizontal axis.

BlockNote image

Start - Elements are aligned from the beginning of the axis.

BlockNote image

Center - Elements are centered.

BlockNote image

End - Elements are aligned from the end of the axis.

BlockNote image

Stretch - Elements are stretched to fit their parent’s size.

BlockNote image

Baseline - Elements are aligned to their baselines (invisible lines that the text sits on).

BlockNote image

4. Wrap

With this property you can enable wrapping child elements of a flex container if they do not fit on one line. By default, child elements are on the same line, and the container may overflow. Wrap helps avoiding this.

BlockNote image
Nowrap

Nowrap

Wrap

Wrap

5. Align Content

You can use Align Content for aligning multiple rows horizontally and vertically.

BlockNote image

Start - Rows are aligned to the top or left of a flex container, respectively.

Center - Rows are centered vertically or horizontally within a flex container, respectively.

End - Rows are aligned to the bottom or right of a flex container, respectively.

Stretch - Rows are stretched to fill empty vertical or horizontal space.

Space-between - Rows or columns are distributed evenly from top to bottom or right to left of a flex container, respectively.

Space-around - Rows or columns are distributed evenly relative to themselves and the edges of a flex container.

Space-evenly - Spacing between rows or columns and from the edges of a flex container to the outermost elements is the same.

BlockNote image

6. Wrap-reverse

The order of the rows along which all the elements in a flex container are distributed is reversed.

BlockNote image

7. Row spacing and line spacing

Gap is used to set the distance between columns and rows and not along the edge of the container. Adjusting spacing helps keeping the proportions inside the parent element and align the content with the container's borders.

BlockNote image

For example, you can arrange images in the center of the container, setting the desired spacing.

Gap not set

Gap not set

Gap: equal spacing for columns and rows

Gap: equal spacing for columns and rows

You can also use spacing between columns and rows with widgets that form lists:

List;

Menu;

Tabs;

Accordion.

Gap feature cannot be used with the Block List widget

To set spacing, select a parent element with the desired list on the Canvas or the Layers tab in the left panel.

You can set two types of spacing:

Row spacing

Sets the spacing between rows.

BlockNote image

Column spacing

Sets the spacing between columns.

BlockNote image

By default,  column spacing is set to 0 . You can set the spacing in the following units:

Pixels px

Percentage %

Spacing is set as a percentage relative to the size of the parent element.

Em

Spacing is relative to the parent element’s font size. 1em is equal to the element’s font size in pixels. The size changes in proportion to changes in the font size.

Viewport Width vw

Spacing is set as a percentage of the width of the browser window. 1vw is equal to 1% of the current width of the browser window.

Viewport Height vh

Spacing is set as a percentage of the height of the browser window. 1vh is equal to 1% of the current height of the browser window.

Child Layout

Child Layout settings are used to setup child elements and allow you to determine child elements’ behavior when a parent element is resized, as well as set custom alignment and order in relation to other child elements.

BlockNote image

Child layout properties:

1. Sizing

The property shows how much an element will shrink or grow relative to neighboring elements when the container is resized.

BlockNote image

Grow and Shrink can have any integer value from 0 and more.

0 means that the element does not shrink or grow when the container is resized.

1 and more means how many times an element shrinks or grows relative to other elements when the container is resized.

For example, if the first element has a Grow value of 2, the second one – 1, and the third – 0, then when the container is resized, the third element will keep its size, the first and the second will share the free space in the container in proportion to the Grow values.

BlockNote image

You can also set the Basis size, which defines the size (in pixels or percentage), from which the element will shrink or expand. By default, the value is set to auto.

2. Align

With Align you can position a child element along the main axis separately from the others.

For example: the properties of a vertical flex container align all the child elements to the left, but with the Child Layout Align the selected element can be positioned in the center.

BlockNote image

3. Order

With Order you can change the ordinal position of a child element in a flex container, i.e. make it first, last, or set a custom order.

Related articles

Semantic Tags
Hiding an Element from the Layout
Position
Grid Layout
Elements layout settings
Flex Layout | База знаний конструктора сайтов Taptop