Flexbox is a set of CSS declarations that allow us to more easily position elements on a web page and create flexible layouts. The idea for the Flexbox model appeared some time before 2008, and the first working draft was published on July 23, 2009. Over the following years, the Flexbox model was developed and adapted to the needs of designers and developers, until October 2017 when the last working draft of the Flexbox model was published.
Flexbox introduces new CSS properties that allow controlling the layout of elements in one dimension - along the main axis and across the cross axis. The main Flexbox properties are:
The Flexbox model is a very useful tool for designing responsive page layouts and managing the layout of elements within specific containers. Thanks to the flexibility and diverse possibilities it offers, Flexbox makes it easier to create unique and aesthetic web page layouts. For many years, styling was done through
float and position properties. Older developers remember table-based layouts. However, they had their problems and sometimes styling was frustrating. The display: flex; declaration comes to the rescue:1section {
2 display: flex;
3}As you can see above, the
display: flex; declaration will apply to the section element selector. In our case, the section will be the parent of three elements with the box class:1<section>
2 <div class="box">Element 1</div>
3 <div class="box">Element 2</div>
4 <div class="box">Element 3</div>
5</section>From the very beginning, we can see that the elements will be placed next to each other:

A flex container is the foundation of a pyramid, and flex items are the stones from which the pyramid is built. Just as stones can be arranged in different ways, flex items can be organized using various properties such as justify-content or align-items.
You'll learn more in the upcoming scrolls of knowledge, and at the end of the module, a special mini-game awaits you (https://flexboxfroggy.com/#en).