53,546 views
???? Get your free ebook on good practices with HTML and CSS: https://www.horadecodar.com.br/ebook-... ★ Our Courses: https://www.horadecodar.com.br/cursos... What is #Flexbox? First, I would like to present some theoretical concepts about Flexbox, which are very important for understanding the whole Flexbox is a value of the #CSS display property, that is, an addition of functionality to this old property Like the other display values, flex will modify the way the elements are displayed In addition, we will always be placing this property in the parent element to affect the child elements We need to create a kind of container to wrap other elements and be able to work with flex And there is still an interesting particularity of Flexbox, which always conditions its elements to a direction By default, the elements are arranged in a row, but we can change it to the columnar arrangement (column) as well How to add flex to CSS? As previously mentioned, we need to encapsulate elements to a parent element. Applying the display property with flex to this element About the Flexbox container We can apply positioning rules to both the parent element and the child elements. First, we will learn how to change the layout from the parent element, and then we will see the individual rules. As you already understood, the layout pattern is in rows, but we can change it to columns. With the flex-direction property, the default value is row and we can put column. There are cases where this formatting better suits our elements, and it is very similar to the behavior of divs without flex. Let's now remove the columnar layout and continue talking about other flex rules. Alignment with Flexbox We can align items horizontally and also vertically. For horizontal alignment, we will use justify-content, with this rule we have some possibilities. ???? Telegram: https://t.me/horadecodar . ???? Discord Hora de Codar: / discord