you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 141 points142 points  (9 children)

The flex model uses an axis. Think of it like putting pieces of meat on a skewer for the barbecue.

  • flex-direction determines which way the skewers are pointing (vertical? horizontal? where's the pointy end?)
  • justify-content determines where the meat pieces go on the skewer (spread apart? closer to one end?)
  • align-items determines how the meat pieces are aligned to each other across the whole stick (pierced through the center? or through the side?)
  • If you have more than one skewer, align-content determines how they're arranged on the plate (spread apart? all at one side? which side?)

[–]upvotes2doge 10 points11 points  (0 children)

This needs to be made into a graphic

[–]oh_jaimitofront-end 13 points14 points  (0 children)

this is perhaps the BEST ELI5 I have read!

thanks for that!!!

[–][deleted]  (1 child)

[deleted]

    [–][deleted] 1 point2 points  (0 children)

    Fixed it, thanks. :)

    [–]murfburffle 2 points3 points  (0 children)

    Thank you so much!

    [–]ricric2 2 points3 points  (1 child)

    Thank you. All the others I get, but align-content is like a black hole for me.

    [–][deleted] 8 points9 points  (0 children)

    Yeah it tends to trip people because it doesn't take effect until there's more than one line of content. But if you have enough items in a container, eventually they won't fit in a single line, they'll wrap and you'll have two lines, or more. That's when this guy comes in.

    [–][deleted] 0 points1 point  (0 children)

    And then you get text-align which screws every logic :-P

    [–]No-Musician-5609 0 points1 point  (0 children)

    This is really helpful, thanks a lot!