How to align elements on Y axis evenly inside a container that is smaller then the sum of the child elements?

30 Views Asked by At

How to align elements evenly inside a container (vertically), having the first element positioned top left (container X,Y) and the last right bottom (X,Y).

I've been trying different calculations so far without success. The container is represented by the yellow element, and the child elements are white.enter image description here

1

There are 1 best solutions below

0
On

I've found the answer.

The Y offset is calculated by subtracting the last element remaining height (rh) and dividing this value by the number of remaining elements (aenter image description here).