divi tips 119

How to reverse the order of the Divi columns in the mobile version?

Updated on 16/10/23

759 words

3 minutes of reading
19 comments

This article contains affiliate links recognizable by the percentage icon (%) → I am an affiliate link

You noticed it, and it pisses you off... You'd like to reverse the direction of the columns of Divi in mobile version.

Indeed, when you create a layout with text on the left and an image on the right then vice versa in the next line, the mobile version is shifted and your layout is not optimal.

If it's on your blog, it may pass, but if it's on your client's website, it won't take him long to see it and ask you to correct it!

Reverse divi columns
Reverse Divi columns in mobile version only

Good news, in this article you will see that it is very simple invert column direction in mobile and tablet version Hey! Here we go!

1 – Reverse Divi Columns: Video tutorial

Once it is not customary, let's start by watching the video. Thus, you will see directly what you need to do to correct this problem and then we move on to the detailed explanations...

2 - The flexbox: essential CSS property

As you saw in the video, we can easily modify the direction of the Divi columns in mobile version, simply thanks to 2 or 3 lines of CSS !

This is possible thanks to the Flexbox, a project integrated with CSS3 in 2016.

With the property display:flexWe can do a lot of things! We can do anything in fact:

  • Change direction with property flex direction
  • Change the switch to the line with flex-wrap
  • Change horizontal alignment with justify-content
  • Change vertical alignment with align-items and align-content
  • Change the order of the child elements with order
  • etc.

Anyway, believe me, flexbox saves lives! And in the case of this article, it is flex direction which allows us to change the direction of Divi columns.

column reverse divi
Property: flex direction – Value: Column-reverse

To better understand how this works, do not hesitate to consult The CSS Tricks article.

Did you know that? You can test Divi for free by visiting on this page and by clicking on "TRY IT FOR FREE"

3 – Les media queries : indispensables pour le responsive

Other essential element for modify the direction of Divi columns on mobile is the use of media queries.

Indeed, you do not want to reverse columns on desktop versions, right? What we want is that it only acts on small screen sizes!

So the media queries are indispensable. It's also CSS, so nothing complicated to understand. If I learned it by myself at more than 30 brooms, you can also learn it. 🤪.

The media queries allow to create CSS rules depending on the size of the screens. It's the base of responsive design.

In our case, here we need to act on small screens, less than 980px. The rule used will therefore be @media screen and ( max-width: 980px ).

To understand how media queries work, do not hesitate to consult The article published on AlsaCreation.

Need to master Divi? Discover my training that accompanies you step by step in the understanding and use of Divi! Learn more about Divi training.

4 - Reverse Divi columns in 3 clicks

As you saw in the video, it's very easy, here are the steps:

snippet reverse column
Change the direction of the Divi columns
  1. First, open the settings of the (green) line that contains the columns to be reversed in a mobile version. Go to tab Advanced and add a CSS class named reverse (This is an example, you can name it as you wish).
  2. Then you go to the tab Divi > Theme Options > Customize CSS (there are several ways add code in Divi).
  3. You add the following code:
@media screen and ( max-width: 980px ) {
    .inverse {
        display: flex;
        flex-direction: column-reverse;
    }
}
  1. Save your changes.

There, nothing simpler! Now your columns display the right order when you visit your site in a mobile version.

Of course, as indicated in the video, you will have to add the CSS class reverse in all rows (green) of your site that pose a problem. Those in the right order in mobile version do not need this class.

5 - In conclusion

So what do you say about this easy-to-apply mini-tips?

By doing some research on the web, I found much more complicated tutorials to finally achieve the same result! For example, here are two:

What do you think?

Invert mobile column
Reverse columns

Get Divi

Divi training

Ebook Divi PDF

Free tips

Divi Quiz

Live coaching

icon 256x256
Discover my wpLingua plugin that makes your WordPress websites multilingual ! SEO-Friendly / Automatic / Editable

19 Comments

  1. françoise
  2. Denis
  3. Lycia Diaz
  4. Lycia Diaz
  5. Lucie
  6. Gransart
  7. Lycia Diaz
  8. valerie M.
  9. Lycia Diaz
  10. Valérie M.
  11. Lycia Diaz
  12. Valérie M.
  13. Lycia Diaz
  14. François
  15. Lycia Diaz
  16. Marine
  17. Lycia Diaz
  18. Julien
  19. Lycia Diaz

Submit a comment

Your email address will not be published. Required fields are indicated with *

This site uses Akismet to reduce undesirables. Learn more about how your feedback data is used.