3 ms·
So, based on a little experimentation, it seems like "align-items" and "align-content" behave identically, except that "align-items" is only used when there is
by teraflop 12y ago
So, based on a little experimentation, it seems like "align-items" and "align-content" behave identically, except that "align-items" is only used when there is one row of boxes and "align-content" is only used when there are multiple rows.
I find it hard to imagine a case where I'd want the alignment to suddenly change based on how my elements happened to be wrapped. Is there ever a situation where this wouldn't be confusing? And if not, why do these two separate properties exist?
(Also, I like this tutorial but there are some race conditions in the implementation. Clicking the "next slide" arrow too fast just replays the fade-in animation instead of advancing the slide. And on slide 30, if you click the "make a menu" link at the wrong time you can end up with the "flexbox in 5 minutes" intro text displayed on top of the boxes.)
- masklinn 12y ago> So, based on a little experimentation, it seems like "align-items" and "align-content" behave identically, except that "align-items" is only used when there is one row of boxes and "align-content" is only used when there are multiple rows. > why do these two separate properties exist? Because they don't behave identically: https://css-tricks.com/snippets/css/a-guide-to-flexbox/ https://css-tricks.com/snippets/css/a-guide-to-flexbox/
- gknoy 12y agoThank you for the explanation. The guide just said "Play with them ...", so it was not obvious (at least to me teraflop) what was different about them.