Source: https://www.elegantthemes.com/blog/divi-resources/how-to-vertically-align-content-in-divi
One column in a multi column row (Flex and Auto Margin)
Ideal to center align a text column next to an image column.
- Row » Sizing » Equalize column heights: enable
- Row » Column » Advanced » Custom CSS » Main element » margin: auto;
- To bottom align, use: margin: auto auto 0;
Note: This option adds margins without column background color.
For a single column alternative
- Row » Column » Advanced » Custom CSS » Main element
(center or bottom align)
display: flex;
flex-direction: column;
justify-content: center; // flex-end;Code language: HTTP (http)
For all columns in a row
- Row » Sizing » Equalize column heights: enable
- Row » Advanced » Custom CSS » Main element » align-items:center;
- To bottom align, use: align-items: flex-end;
Note: this option adds margins without column background color
More options
http://divisoup.com/quick-snack-vertically-center-any-content-in-divi/
- Enable equalize column heights
- Add hws-vertical-align-column to the CSS class of either the module, or the row column custom CSS.
- Add the following CSS to the Custom CSS in the Divi options
On columns
Important: the row must have a 100vh height!
/* -- START vertically align column text -- */
.hws-vertical-align-column {
display: flex;
flex-direction: column;
justify-content: center;
}
/* -- END vertical align column text -- */
Code language: CSS (css)
On modules
/* -- START vertically align module text -- */
.hws-vertical-align-module {
display: flex;
flex-wrap: wrap;
align-content: center; }
/* -- END vertical align module text -- */Code language: CSS (css)
More information
- Equalize column heigts enables flex on rows
- This adds a margin at the top/bottom of the column so they are the same size
- Then in the row column main element css box:
margin: auto;- Or to stack at the bottom of the column:
margin: autoauto0;
- Or to stack at the bottom of the column:
- Or in the row main element css:
align-items: center;- Or to stack at the bottom of the column:
align-items: flex-end;
- Or to stack at the bottom of the column:
- To not have a margin added at the top/bottom, use the CSS