May 3rd, 2019
Today I started on a new challenge: CSS Flexbox
Layouts of elements have always been a challenge in web design. Especially in earlier years when browsers interpreted code so differently.
CSS3 introduced Flexible Boxes to help out with this challenge. All modern browsers support Flex Box, which lets us create dynamic page layouts.
In order for us to use flex properties on an element, we need to place the CSS property display: flex on it. When we do, the elements inside this parent container is now flexible. The parent element is turned into a flex container.
If we have two elements inside an element with display:flex on it, they will be positioned next to each other.
flex-direction is the property that determines if we should turn the elements inside a flex container to rows or columns. We set this in the parent element (the flex container). Creating a row (default) will align the children horizontally. And creating a column will align the children vertically. There is also the possibility for row-reverse and column-reverse.