This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
John Lee
Posted Mar 06 - Read on Facebook

Could anyone point me towards justifying layers (in the center) of parent container with the same margin on both sides?
For example - I have a box = 200, then I have a loop which with 6 layers. How do I evenly distribute the layers inside the box so their centers are evenly spaced? In my example, all the dots are left aligned... this is not what i want. thanks!!


Juanmnl Cornejo

You can do that with flexbox :)

Juanmnl Cornejo

don't have much time to dig deeper, but this is a quick example :)

Chris Camargo

Why not just place them in a parent layer, and center the parent?

Mike Johnson

There is a two part FramerCasts on flexbox.

Jordan Robert Dobson

Well what you want to do is take the parents width and subtract the widths of all the children from the parent width.

Then you count the spaces in between, which would be one less than the total number of boxes (5) and divide the reminder after you've subtracted the widths and then you have the amount to place on the x position (boxWidth + remainingSpace) * index

I think should work.

Read the entire post on Facebook