purpose¶
flex is another modern layout engine that tries to solve or at least alleviate
the obvious deficiencies of the old-school block model and related tools
as opposed to grids, it is concerned with 1-dimension flow of data
it complements nicely what is doable with grids
ex1 - default is row nowrap¶
by default, direction: row, wrap: nowrap
ex2 - flex-wrap: wrap¶
identical except that we specify flex-wrap: wrap
assignment: the css-tricks page¶
the flex display is an extremely powerful tool for fine-grained control over your layout
to deepen your understanding of it :
this page on css-trick.com is an easy, and very complete, read on flex
it is again strongly recommended that you browse it thoroughly to get a perception of what is doable with this layout
grid’s and flex’s¶
as mentioned earlier, both display policies have their own pros and cons
you should not think in terms or one or the other
but rather in terms of using both depending on the situation
so do not hesitate to define nested layouts
with flex’s in grid’s in flex’s in grid’s ... as neededthis is why the
<div>tag is soooo all over the place
practice: layout a header¶
mimick the layout below
optional activity
Flexbox Froggy https://
challenge (optional)¶
if you believe you have a full understanding of how CSS layouts work,
you should give this test a shot
(and you will feel more humble afterwards ;-)