Sizing flex items on the last row

Unfortunately, in the current iteration of flexbox (Level 1), there is no clean way to solve the last-row alignment problem. It’s a common problem.

It would be useful to have a flex property along the lines of:

  • last-row
  • last-column
  • only-child-in-a-row
  • alone-in-a-column

This problem does appear to be a high priority for Flexbox Level 2:

Although this behavior is difficult to achieve in flexbox, it’s simple and easy in CSS Grid Layout:

In case Grid is not an option, here’s a list of similar questions containing various flexbox hacks:

Leave a Comment