I'm creating a carousel that will display an instagram feed. Instagram pictures are square, so the plan is to create a row of a few square picture containers and redistribute the rest of the space to left and right buttons.
The site layout is fluid and flexbox-based. Please see the fiddle https://jsfiddle.net/xc196he7/. As you can see, the space is distributed this way - 1/5 to the header, and 2/5 to the carousel and the footer.
My problem is with the squares. The carousel height is entirely fluid. Is there a way to set each square width equal to that height? The
.photo
{
flex: 0 0 30%;
}
approach is wrong, it's just there to show the expected result. The remaining space is redistributed this way
.left, .right
{
flex-grow: 1;
}
Is it possible with pure CSS or the only way is to set the width with JS?