Interactive online courses HTML Academy
2026-03-09 14:06 Diff

Will the result be the same as in the figure below if you rotated the main axis in the previous assignment?

No, it will not be the same!

The old, non-flexbox properties, such as the margins or sizes, know nothing about the flow direction of the axes. They think according to the old paradigm using the concepts of “top” and “bottom”, “right” and “left”.

Therefore, when the main axis is oriented from left to right, horizontal margins move the flex items along the main axis. But if you direct the flow of the main axis from top to bottom, then the same margins will start to function along the cross axis.

The same applies to vertical margins.

Let’s rotate the axis and then make changes and obtain the result depicted in the figure above.