How to Make Images Grayscale with CSS in Divi

by | Last updated May 9, 2026 | Divi Tutorials

Changing images into grayscale for your Divi website can be done without the need for an editing software like Photoshop. You will just need a few lines of CSS code to achieve this effect.

One scenario where grayscale images might be required is when displaying partner logos on your website’s homepage. If you wish to present all these logos in a grayscale format, the process is very simple.

In this tutorial, we are going to change this…

before-grayscale

… to this:

after-grayscale

The first step is to assign a CSS class to each image you want to convert to grayscale. For this example, we’ll use the class name “dbgs”.

assign css class name

After that you need to add the following CSS code to the Divi theme options custom CSS field:

/* Make images grayscale in Divi */
.dbgs {
    -webkit-filter: grayscale(100%);
    filter: grayscale(100%);
    opacity: 0.6;
    filter: alpha(opacity=60);
}

In WordPress admin go to Divi -> Theme Options -> General and scroll down to Custom CSS box.

Here is a tutorial showing you where to place the CSS code in Divi.

Explaining the code

The first 2 lines of this code convert the image(s) into grayscale. The other 2 lines of the code changes the opacity of these images to 60 % o they are not too dark gray.

If you want to make grayscale just one image, you can apply the 4 lines of the above CSS code (from inside the brackets) just to the Main Element Custom CSS field in the advanced options of your image module.

Here is a demo:

Grayscale one image demo

I hope that you enjoyed this post. Subscribe to Divi Banks on YouTube and join our newsletter for more crisp content on WordPress and web design.

Shop Divi Products

Buy nicely done Divi Layouts, Child themes, and extensions for your next Divi project.

Related Articles

How to Add Padding Around Featured Images in Divi’s Blog Module

How to Add Padding Around Featured Images in Divi’s Blog Module

If you're using the Divi theme for your WordPress website and want to customize the appearance of your blog posts page, one simple tweak you can make is adding padding around the featured images. This can help create a more visually appealing layout and better...

Divi Logo Guide: Everything You Need to Know

Divi Logo Guide: Everything You Need to Know

A professionally designed logo is a powerful branding asset that can leave a lasting impression on your website visitors. Research shows that a well-designed logo can boost consumer trust in a brand by an impressive 75%. But the question most people ask is – how do...

Leave a Comment

0 Comments

Submit a Comment

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

WP101 - FREE WordPress Tutorials

Enter your email address below to gain access to the FREE WordPress training.

You have Successfully Subscribed!

Pin It on Pinterest