Box level alignment
Edit on GithubThese examples shows different ways relating to the alignment of boxes within their containers in the various CSS box layout models: block layout, table layout, flex layout
NOTE: Grid is not currently supported
align-content
construct
#
Aligns the contents of the box as a whole (as the alignment subject) within the box itself along the block/column/cross axis of the box. Following example shows Ac(sb)
, align-content: Space between
align-items
construct
#
This property specifies the default align-self
for all of the child boxes (including anonymous boxes) participating in this box’s formatting context.. Following example shows Ai(c)
, align-items: center
align-self
construct
#
Aligns the box (as the alignment subject) within its containing block (as the alignment container) along the block/column/cross axis of the alignment container: the box’s outer edges are aligned within its alignment container as described by its alignment value. Following example shows As(fs)
, align-self: flex-start
justify-content
construct
#
Aligns the contents of the box as a whole (as the alignment subject) within the box itself (as the alignment container) along the inline/row/main axis of the box. Following example shows Jc(se)
, justify-content: space-evenly