All Collections
FAQ's and Troubleshooting
Optimizing The Divi Layouts For Certain Mobile Devices
Optimizing The Divi Layouts For Certain Mobile Devices

Advanced tutorial on using CSS classes and Media Queries to adjust layouts for mobile devices.

Karen avatar
Written by Karen
Updated over a week ago

Normally, you should be able to optimize Divi for three different types of devices: Desktop/Tablet/Mobile. More info about it here: Website Does Not Look Good On Mobile. However, if you still need to apply a different layout for a specific device you can add some simple CSS lines. Here are the steps you should go through for that:

  1. Add an additional CSS class to the Divi item you want to hide. For example, let's add ipad-landscape-hide class. It can be whatever name you want. 

  2. Also, add another class to the Divi item that you want to display instead of the hidden item. Let's add ipad-landscape-display class.

  3. Finally, we need to add the following CSS snippet to the Wp-admin > Divi > Theme options > Custom CSS option:

.ipad-landscape-display { display: none; }
@media screen
and (min-width : 768px)
and (max-width : 1024px)  {
   .ipad-landscape-hide { display: none; }
   div.ipad-landscape-display { display: block; }
}


You can repeat the same process for different screen sizes. Simply repeat this code:

@media screen
and (min-width : 768px)
and (max-width : 1024px)  {
   .ipad-landscape-hide { display: none; }
   div.ipad-landscape-display { display: block; }
}


and modify all the screen size values. If you want to learn more about different options for @media queries please check out this link.

Did this answer your question?