tools = require('../js/tools'); tools.init()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 behaviour¶
by default, direction: row, wrap: nowrap
ex2 - wrap mode¶
identical except that we specify flex-wrap: wrap
assignment¶
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
use cases¶
the
flexdisplay is an extremely powerful tool for fine-grained control over your layoutit could clearly be the default behaviour (but is not just for legacy)
when writing a new page from scratch, using
flexis almost always a good idea
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 or the other way around, of course
this is why the
<div>tag is so all over the place
practice¶
mimick the layout below
optional activity¶
Flexbox Froggy https://