Imagine this layout:
[BOX] [BOX] [BOX]
[ BOX ]
Which is a flexbox design, and – if the screen shrinks – will look like this:
[ BOX ] [ BOX ]
[ BOX ]
[ BOX ]
And would become a set of 4 rows if the screen is too narrow to display even two boxes next to one another.
So far so good.
I am looking for a way to target the last element in the upper row, no matter how the flexbox has currently adjusted to its environment.
Naturally i thought of CSS pseudo-classes, but i was unable to find anything other than the typical ones, such as :last-child
and :last-of-type
or :nth-child
, which would not help in this situation.
QUESTION
Is there a way to do this purely in CSS? If yes, how?