CSS Media Queries for the Divi Theme

Written by Dan Mossop

The Divi Theme uses a responsive design, meaning it adjusts its layout to look good on any size of screen. This is achieved using CSS styles targeted at particular screen sizes using a technique called "media queries".

If we're looking to make changes to Divi using our own CSS, it can be useful to know the exact media queries Divi uses so that our styles are applied to the correct Divi layout. Here are the media queries Divi uses:

/* Large screens (1405px upwards) */
@media only screen and ( min-width: 1405px ) { 
    /* your css goes here */
}

/* Laptops and desktops (1100-1405px) */
@media only screen and ( min-width: 1100px ) and ( max-width: 1405px) { 
    /* your css goes here */
}

/* Tablets in landscape mode (981-1100px) */
@media only screen and ( min-width: 981px ) and ( max-width: 1100px ) { 
    /* your css goes here */
}

/* Tablets in portrait mode (768-980px) */
@media only screen and ( min-width: 768px ) and ( max-width: 980px ) {
    /* your css goes here */
}

/* Smartphones in landscape mode (480-768px) */
@media only screen and ( min-width: 480px ) and ( max-width: 767px ) {
    /* your css goes here */
}

/* Smartphones in portrait mode (0-479px) */
@media only screen and ( max-width: 479px ) {
    /* your css goes here */
}

I've added comments giving an indication of the type of devices (smartphones, laptops, etc) that will show each layout size, but note that this is a rough guide only – there is some overlap in which device types will show which screen resolution.

Enhance Your Divi Sites with Dynamic Functionality!

Maximize the potential of your Divi website by incorporating dynamic functionality using the Divi PHP Code Module. Perfect for users looking to apply custom CSS and PHP code, this module allows you to run PHP directly within your Divi layouts, unlocking new possibilities for customization and feature addition.

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

24 Comments

  1. Hello! Thanks for this useful snippet but…

    I think min-width should be 1101 instead of 1100 to avoid the 1px flash on resizing, no?

    Reply
    • Hey Mister WP! Thanks for pointing this out. Technically, you're correct, of course. It should be 1101px to avoid an overlap, and similarly the min-width for the first block (large screens) should be 1406px. However, Divi itself uses 1100px as both the min and max width in its CSS (and hence suffers from the overlap issue), so if you're trying to override these Divi styles you'd actually need to use a min-width of 1100px to avoid the 1px flash. The same is true for 1405px, again used as both the min and max width in Divi's media queries. If you're adding your own styles and want to ensure a smooth transition then definitely use 1101px and 1406px. But for overriding Divi's styles, use 1100px and 1405px. I've left 1100px and 1405px in the post as my aim was to present the media queries Divi actually uses. I hope that all makes sense! Dan

      Reply
      • For sure, thanks Dan for the full explanation! It makes sense and I am sure it will interest your other readers. Thanks again!

        Reply
        • You're welcome, Mister WP, and thanks for pointing it out in the first place. Cheers!

          Reply
  2. Thanks for sharing this responsive css.

    Reply

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

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

We may earn a commission when you visit links on our website.

Latest From Divi Booster

Set Hover Color for Menu Links in the Divi Menu Module

Customizing the hover color of menu links lets you enhance the user experience and maintain visual consistency with your website’s brand. By setting a specific hover color, you can guide visitors' attention and improve navigation feedback. In this guide we show you...

Enable Automatic Looping for YouTube Videos in the Divi Video Module

Enabling automatic looping for YouTube videos in your Divi video module ensures that content plays seamlessly and continuously without interruption. This feature can enhance user engagement, highlight key information, or create dynamic visual effects on your website....

Hide Video Controls in Divi Video Module

Disabling YouTube video controls in the Divi Video Module helps create a seamless, distraction-free viewing experience for your site visitors. This approach is useful when you want full control over how your video content appears and is interacted with on the page, or...

Mute YouTube Videos by Default in the Divi Video Module

In the Divi Video Module, starting your YouTube videos muted by default can create a more user-friendly browsing experience on your webpage. It is particularly beneficial for reducing distractions, enhancing visitor engagement, and providing a seamless content preview...

Autoplay Videos in Divi Video Module

Enabling videos in your Divi video module to start playing automatically can enhance both the site's design and user engagement. To ensure full compatibility with browser requirements, such as Chrome's autoplay policy, it's often necessary to start your videos muted...

Random Divi Posts