When you create a flex container (by applying display: flex or display: inline-flex to an element), the child elements become flexible. The descendants of a flexible container outside of children do not become flexible elements and therefore do not accept flexible properties.
When you make a .proj_images flexible container, the flex properties apply to the unique flex: .images . To apply flexibility properties to four images, add display: flex to .images .
In addition, when you install the flex container, several default rules apply. Two of these rules are flex-direction: row and flex-wrap: nowrap . If you want the images to be aligned vertically or for wrapping, you need to override these defaults with flex-direction: column and flex-wrap: wrap .
For more information on centering flex elements horizontally (and vertically), see my answer here: fooobar.com/questions/1597 / ...
source share