🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › align-content
align-content - CSS | MDN
The CSS align-content property sets the distribution of space between and around content items along a flexbox's cross axis, or a grid or block-level element's block axis.
🌐
W3Schools
w3schools.com › cssref › css3_pr_align-content.php
CSS align-content property
The align-content property specifies how flex lines are distributed along the cross axis in a flexbox container.
🌐
freeCodeCamp
forum.freecodecamp.org › html-css
Justify-content & align-content vs justify-items and align-items - HTML-CSS - The freeCodeCamp Forum
July 18, 2021 - It’s very confusing. I saw some stackoverflow answers, but I didn’t quite get it. They used a lot of complicated terminology. Thank you in advance! 😀
🌐
GeeksforGeeks
geeksforgeeks.org › css › difference-between-align-content-and-align-items
Difference between align-content and align-items - GeeksforGeeks
July 15, 2025 - element{ align-items:stretch | center | flex-start | flex-end | baseline | initial | inherit; // CSS Property } Example for align-content
🌐
CSS Park
csspark.com › information desk › properties › align-content
align-content - CSS Park
October 4, 2014 - Information desk » CSS » Properties » A » align-content · Last updated on September 03, 2014 · The align-content property is a sub-property of the Flexible Box Layout module.
🌐
GeeksforGeeks
geeksforgeeks.org › css › css-align
CSS Align - GeeksforGeeks
July 23, 2024 - CSS alignment techniques are essential ... These techniques include horizontal and vertical alignment using various properties such as margin: auto, position: absolute, text-align, and padding....
🌐
CSS-Tricks
css-tricks.com › almanac › properties › a › align-content
align-content | CSS-Tricks
April 19, 2025 - It helps to align a flex container’s lines within it when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis.
Find elsewhere
🌐
Tailwind CSS
tailwindcss.com › docs › align-content
align-content - Flexbox & Grid - Tailwind CSS
Utilities for controlling how rows are positioned in multi-row flex and grid containers.
🌐
Medium
medium.com › @chrisroyalty001 › understanding-css-align-content-align-items-and-align-self-998b7db0ec6a
Understanding CSS align-content , align-items, and align-self:
August 24, 2024 - Understanding align-content , align-items, and align-self: These three CSS properties are used in flexbox and grid layouts to control the alignment of items and lines. Here’s a comprehensive guide …
🌐
OSTraining
ostraining.com › blog › webdesign › css-flexbox-the-align-content-property
CSS Flexbox #9. The align-content Property - OSTraining
November 15, 2022 - In the third tutorial of this series, you learned that the align-items flexbox property specifies how flex-items are distributed along the cross axis of the
🌐
The Odin Project
theodinproject.com › lessons › foundations-intro-to-css
Intro to CSS | The Odin Project
text-align will align text horizontally within an element, and you can use the common keywords you may have come across in word processors as the value for this property, e.g.
🌐
Css-tip
css-tip.com › explore › alignment
The Fundamentals of CSS Alignment
September 12, 2025 - In every CSS layout, we have two levels of alignment: content and item. For the item level, we can either align each item individually or apply the same alignment to all the items.
🌐
Kyle Shevlin's Blog
kyleshevlin.com › align-items-center-vs-text-align-center
align-items: center vs. text-align: center | Kyle Shevlin
When the text is short, it can seem like which CSS you use doesn’t matter, but if we were to add a background to the text in our first two examples, we’d notice the difference right away. ... When we change align-items to center, we shrink all the children to their minimum content width.
🌐
Tailwind CSS
tailwindcss.com › docs › justify-content
justify-content - Flexbox & Grid - Tailwind CSS
When there is not enough space available, the justify-end-safe utility will align items to the start of the container instead of the end.
🌐
Reddit
reddit.com › r/webdev › confused about align-content, align-items, justify-content, justify-items???
r/webdev on Reddit: Confused about align-content, align-items, justify-content, justify-items???
May 7, 2021 -

https://codepen.io/cgregurich/pen/jOBEZXb

I'm trying to understand flex box and stuff, and I'm very confused by align-content vs align-items and justify-content vs justify-items.

I don't think my confusion has much to do with understanding the different between align VS justify, but rather the difference between items and content.

Mainly the fact that to get this to display as I want (numbers in the center of the boxes), I have to use justify-content and align-items, but if I were to use justify-items and align-content then it doesn't work as desired.

Why?

Top answer
1 of 8
6
In particular for flexbox the Flexbox Froggy game is a very neat teaching tool.
2 of 8
6
justify-items: Sets the justify-self of all the child items in the container. It defines how each individual child element is aligned within it's alignment container. This distinction is important: A grid element's alignment container is not the entire grid; It is the individual box the element resides in. justify-content: Aligns the contents of the container with the container itself. For a flex container this is along the main axis (the main axis is horizontal or vertical depending on whether the flex container is a row or a column). For a grid container this is the inline axis (the row axis). align-items: Sets the align-self of all items in a container. For flex containers, the alignment is along the cross axis (opposite of the above-mentioned main axis). For grid containers, the alignment is along the block axis (opposite of the above-mentioned inline/row axis). This is again similar to justify-items in that each individual child element is aligned within it's alignment container. align-content: Aligns the child elements within the container itself (aka. the space between and around all child containers) along the cross axis (if the parent is a flexbox) or block axis (if parent is a grid). Notice the distinction here: *-items: The alignment container is each individual child elements "box" within the parent element. *-content: The alignment container is the parent element itself. Mainly the fact that to get this to display as I want (numbers in the center of the boxes), I have to use justify-content and align-items, but if I were to use justify-items and align-content then it doesn't work as desired. Why? The MDN covers this . In short, justify-self is ignored by Flexbox because content is treated as a group along the main axis. The alignment container for a flexbox is the entire main axis, so justify-self (and by extension justify-items) would be redundant. As to why align-content doesn't work in your example: "This property has no effect on single line flex containers (i.e. ones with flex-wrap: nowrap)." (from MDN). In your example, the flex boxes are all single line. You could get align-content: center; to work if you add flex-wrap: wrap to the parent element.
🌐
TutorialsPoint
tutorialspoint.com › css › css_flexbox_align-content.htm
CSS Flexbox - align-content
CSS align-content property used to control distributed between and around content items along the cross-axis of a flexbox or the block axis of a grid.
🌐
Thedevspace
thedevspace.io › course › htmlcss-justify-and-align
Understanding CSS Alignment Properties Justify and Align | TheDevSpace
The align-content property specifies how the rows are positioned in a multi-row grid or flex container.