COMP 126: Practical Web Design & Development for Everyone
& items can also be containers with items of their own!
.container {
display: flex;
}
<div class="container">
<div class="item1">item one</div>
<div class="item1">item two</div>
<div class="item1">item three</div>
</div>
display (flex or inline-flex)
flex-direction (sets main axis)
flex-wrap (do items wrap from line to line inside container or just shrink/expand?)
flex-flow (shorthand for flex-direction and flex-wrap)
justify-content (aligns items along main axis)
align-items (aligns items along cross axis)
align-content (aligns multiple lines of items along cross axis)
gap, row-gap, column-gap (adds gaps between flex items)
These properties can only be applied to a container element to which you've applied display: flex;
Used primarily when the flex-items' sizes are fixed or at their max-height/max-width
These properties can only be applied to individual items within a flex container