Source: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Properties for the Parent (flex container)
You would add this to a row column that contains the Divi modules.
.container {
display: flex;
flex-direction: row | row-reverse | column | column-reverse;
flex-wrap: nowrap | wrap | wrap-reverse;
flex-flow: column wrap;
justify-content: flex-start/end | center | left | right … ;
align-items: stretch | flex-start … ;
align-content: flex-start | flex-end | center … ;
gap: 10px;
}Code language: CSS (css)
- Display flex: enables a flex context for all its direct children.
- Flex-direction: defines the direction flex items are placed in the flex container.
- Flex-wrap: to wrap instead of fit on one line.
- Flex-flow: shorthand for the flex-direction and flex-wrap.
- Justify-content: to center horizontaly
flex-start | flex-end | center | space-between | space-around | space-evenly | start | end | left | right … + safe | unsafe; - Align-items: center verticaly
stretch | flex-start | flex-end | center | baseline | first baseline | last baseline | start | end | self-start | self-end + … safe | unsafe; - Align-content: space between items
align-content: flex-start | flex-end | center | space-between | space-around | space-evenly | stretch | start | end | baseline | first baseline | last baseline + … safe | unsafe - Gap, row-gap, column-gap: controls the space between flex items, as a minimum gutter
Properties for the Children (flex items)
.item {
order: 5;
flex-grow: 4;
flex-shrink: 3;
flex-basis: 0 | auto;
flex: none;
align-self: auto;
}Code language: CSS (css)
- Order: change the order of items
- Flex-grow: dictates what amount of the available space inside the flex container the item should take up.
- Flex-shrink: defines the ability for a flex item to shrink if necessary.
- Flex-basis: defines the default size of an element before the remaining space is distributed.
- Flex: shorthand for flex-grow, flex-shrink and flex-basis combined.
- Align-self: allows the default alignment (or the one specified by align-items) to be overridden for individual flex items.