How To Vertically Center Content in Divi

How To Vertically Center Content in Divi

Josh Hall

6 лет назад

27,435 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

MasterT
MasterT - 29.07.2022 09:24

this very basic function should be part already with the builder.

Ответить
avviano
avviano - 07.07.2022 11:43

What worked for me was to add the following code to the underlying section: Section Settings > Advanced (Custom CSS) > Main Element and then paste the following code into the code window:

display: flex;
justify-content: center;
align-items: center;
flex-direction: column;

This will vertically center the row contained in a section within the browser's viewport.

Ответить
Jeff Hunter
Jeff Hunter - 01.06.2022 18:30

Just FYI for all, this technique is no longer valid. After futzing around for 30 min trying this technique, it won't work in the latest version. Its MUCH simpler now. On the Row, click the gear icon (settings) and set Sizing>Equalize Columns = Yes, THEN in the same Row Settings, click CONTENT and for each column (Column Settings) you want to be set, add margin:auto; to the custom CSS for each column. Job done...

Ответить
Joana Jiménez Fernández
Joana Jiménez Fernández - 07.07.2021 18:13

thanks, real usefull

Ответить
logosi ismyname
logosi ismyname - 09.06.2021 04:32

Thanks, just what I needed. Divi should add that feature into the builder.

Ответить
Eirik Fesker
Eirik Fesker - 12.02.2021 11:39

and how can i achieve that the row is centered on the screen? my row sticks on top...

Ответить
QLF
QLF - 12.10.2020 15:40

I dont have columb 1 CSS class?

Ответить
Ayaan Ahmed Shohan
Ayaan Ahmed Shohan - 18.06.2020 00:09

yup , its easy pesy

Ответить
Alex Venetikidis
Alex Venetikidis - 28.05.2020 19:07

Thanks for this. Once again I am in awe that this is not a built in feature of Divi. In Elementor it is one of the very first settings one can make for a row, a section etc. But in Divi, yet again: you need to use CSS. What a bummer. I am glad that I have to use this page builder of death only for one client.

Ответить
M Chandra
M Chandra - 10.05.2020 20:00

Hey Josh!
Unfortunately, I'm trying to use this super handy tip to vertically align my columns, but seems its no longer working on divi's latest update.

Notice divi's latest version is no longer showing separate classes in the Row Advanced Settings. Instead there is now an option to individually adjust entire column settings.

Could you please help post an update?

Thanks for this amazing tip in advance! :)
Cheers

Ответить
jose aries Tan
jose aries Tan - 04.05.2020 16:34

just subscribed because of this tutorial!

Ответить
Bluetopia
Bluetopia - 15.04.2020 09:41

I'm so fucking stunned. It worked! It is soooo beautiful. Thanks a lot, Josh. Thank you thousand times!

Ответить
Chicco B
Chicco B - 04.04.2020 10:19

What?!? All of this to have a vertical align?!?!? Really?!?!?!?

Ответить
Maxim for all
Maxim for all - 27.02.2020 14:31

.vertical-align {
display: flex;
flex-direction: column;
justify-content: center;
}

Ответить
Danny Bribiesca
Danny Bribiesca - 19.02.2020 22:53

Awesome! Thanks for the help!! This works like a charm :)

Ответить
Zach Bradshaw
Zach Bradshaw - 01.02.2020 23:57

Hi Josh, thanks for the great tutorial! Is this still the best way to do this in Divi in 2020? Thanks again!

Ответить
MusicShell
MusicShell - 16.01.2020 14:21

Why on earth isn't this option implemented in the divi builder already? On switch , like "full-width row" or "equalize column height" ...

Ответить
Omar Altamirano
Omar Altamirano - 23.10.2019 19:28

Hi Josh! it worked for me in desktop but on mobile it just ignore the CSS, let me explain what I am doing, I have 3 columns and I follow your tutorial to keep those 3 on mobile use width 33%, then I add all the flex CSS to center all these 3 elements, what really confused me is that i can keep the 3 columns on mobile but they are not center and on desktop al the CSS work perfectly, thanks in advanced
My code
.three-columns .et_pb_column{
width: 33.33%!important;
display: flex;
flex-direction: column;
justify-content: center;
}

Ответить
Miro Faltinek
Miro Faltinek - 16.07.2019 10:28

Thank, Josh. Simple and very useful tutorial.

Ответить
Gavin Roche
Gavin Roche - 17.05.2019 00:38

Thanks Josh! Worked a treat. Nice clear video.

Ответить