Here is my starting point: Click here
The spacing I have on the sides of the container is larger than between the content. When resizing the window, the elements eventually wrap to the second line.
I want to set a breakpoint so that when the content moves to the second line, the two right-most content divs move together.
On each line in the container, I want it to look like this:
large buffer - content - small buffer - content - large buffer
Can this be done with CSS only or do I need JavaScript?
Edit: Adding code from Fiddle below.
HTML
<div class="outer_container">
<div class="outer_buffer"></div>
<div class="content">Some Content</div>
<div class="inner_buffer"></div>
<div class="content">Some Content</div>
<div class="inner_buffer"></div>
<div class="content">Some Content</div>
<div class="inner_buffer"></div>
<div class="content">Some Content</div>
<div class="outer_buffer"></div>
</div>
CSS
.outer_container{
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.outer_buffer{
flex-grow: 10;
}
.inner_buffer{
flex-grow: 2.5;
}
.content{
width: 50px;
border: solid 1px red;
}