



flex-direction:row means that elements inside the flex container are aligned next to each other. Main Axis: The axis defined by the flex-direction property.Flex Items: Direct children of the flex containers are called flex items.Flex Container: An element on which the display value is set to flex.The rest of the article is just a brain dump of everything I learned while trying to figure out the above. This means that this property has no effect on single-line containers. align-content effects the alignment accross lines of a flex-container.align-items effect the alignment of items on the current line.What separates align-items and align-content? See the Pen Align items vs Justify Content by Anirudh Varma If you have set your flex-direction to column, then align-* properties work on the horizontal axis and justify-content works on the vertical axis.If you have set your flex-direction to row, then justify-content works on the horizontal axis and align-* properties work on the vertical axis.To align or to justify.that is the questionįor a very long time, I have been trying to figure out what is the difference between align-items, align-content & justify-content and how they work or more importantly when they work. If you have worked with modern CSS, whether you are rolling your own or using a frameworks like Bootstrap & Foundation, chances are you are using Flexbox for layout and alignment.

This post was originally posted on my blogįlexbox is awesome.
