Creating a Unique Border for your Divi Gallery Module Images

Last Updated on September 22, 2022 by 18 Comments

Creating a Unique Border for your Divi Gallery Module Images
Blog / Divi Resources / Creating a Unique Border for your Divi Gallery Module Images
Play Button

This post is part 3 of 5 in our mini series titled 5 Impressive Divi Gallery Layouts and How to Create Them. Stay tuned for all five unique examples of the gallery module and tutorials on how to achieve them!


In this third example, we’re going to be using a CSS “clipping mask” to create a nifty little border around our gallery images. If you’re not too familiar with CSS, don’t worry, I’ll provide the code and explain what it’s for and how to use it. If you’re new to CSS, my goal is to make it a little less daunting and for you to see how just a few lines of code can take your designs to the next level.

Today’s Before & After: The Divi Gallery Module

The image below represents our starting point. All I’ve done is added twelve images to the Divi Gallery Module without making any other changes.

Default Gallery Module

Default Gallery Module Hover Over

By the end of our tutorial today we’re going to get a cleaner gallery (with less text) and images that have a CSS clipping mask that provides bespoke detail.

Example 3 - Hover Over

Example 3 – Hover Over

How to Create Unique Image Borders with the Divi Gallery Module

Subscribe To Our Youtube Channel

Concept & Inspiration for the Unique Border Images Gallery Module

There are many circumstances where you’ll be able to utilize unique borders for your gallery images. I often use custom borders on gallery images in order to tie in the look with other graphic elements around the site. Say you have several images and graphics with rounded edges, wouldn’t it be nice to have your galleries mirror that look and have a streamlined feel across the site? With some simple CSS adjustments, we can do just that!

Preparing Your Design Elements

To follow along with today’s tutorial you’ll need twelve royalty free images sized 1200px wide with a height of 1000px. As the other two posts in this miniseries have mentioned it would be a good ideas to compress these images for smaller file sizes too. To learn how to both resize your images and compress them, check out this tutorial we’ve created to help you get the most out of your image assets.

To achieve our clipping mask I used http://bennettfeely.com/clippy/ to create the border in this example. This is a very handy (and free) tool you can use to create whatever border shape you’d like for your image. It can be used to create a circle, rounded edges, a variety of shapes and more.

Implementing the Tiled Gallery with Custom Padding Module Design in Divi

For this example, we’ll use the Divi Gallery Module and make adjustments in these 3 areas:

– General Settings
– Advanced Design Settings
– Custom CSS Settings

Setting's we'll change.

Setting’s we’ll change.

To begin, create a single section with a single row and single gallery module.

Gallery Module Settings

General Settings:

Gallery Images: Added the images to the gallery
Layout: Grid
Images Number: 12
Show Title and Caption: NO
Show Pagination: NO

Example 3 General Settings

Example 3 General Settings

Advanced General Settings:

Zoom Icon Color: #1f7cba
Hover Overlay Color: rgba(255,255,255,0.82)
Hover Icon Picker: Computer mouse pointer

One of my favorite parts about the Divi Gallery Module is that it gives us the ability to change the hover over icon. For this example, I’m using the mouse pointer to give the user a Call-To-Action. A little web psychology here – when someone see’s a mouse clicker, the nature instinct is to “click.” So this can be very useful for galleries when you want the website user to click open an image.

I’m going with a blue icon over a transparent white overlay but you can use whatever color will match the site you’re working on.

Example 3 Advanced Design Settings

Example 3 Advanced Design Settings

Custom CSS:

Gallery Item:

-webkit-clip-path: polygon(85% 0, 100% 13%, 100% 100%, 15% 100%, 0 86%, 0 0);
clip-path: polygon(85% 0, 100% 13%, 100% 100%, 15% 100%, 0 86%, 0 0);

The gallery item section here singles out each image in the gallery so whatever adjustments you make here will effect every image. This CSS code tells the image where the clipping should occur and you can see that by the percentages on the clip path. Good news is, if you use the tool I mentioned above, you don’t have to code any of that by hand 😉 Just create your shape and copy the code.

Example 3 Custom CSS

Example 3 Custom CSS

Save & Exit

Example 3 - Hover Over

Your final design, unique border images with the Divi Gallery Module!

And that’s it! With some adjustments to the basic Divi Gallery Module settings and just a couple lines of CSS, we’ve created a very unique looking border to our gallery images. Again, you can play around with the clipping mask and create whatever shape or border style you’d like for your images!

Tomorrow: Changing the Number of Columns in the Divi Gallery Module

Have you ever wanted more or less columns in your Divi gallery? Check back tomorrow for example 4 – where I’ll show you how to increase the number of columns and will give you the code to create a 2, 3, 5 or 6 column gallery!

Example 4 -

Example 4 – Adding Columns

Be sure to subscribe to our email newsletter and YouTube channel so that you never miss a big announcement, useful tip, or Divi freebie!

Divi Marketplace

Are You A Divi User? Find Out How To Get More From Divi! 👇

Browse hundreds of modules and thousands of layouts.

Visit Marketplace
Divi Marketplace
Divi Cloud

Find Out How To Improve Your Divi Workflow 👇

Learn about the new way to manage your Divi assets.

Get Divi Cloud
Divi Cloud
Divi Hosting

Want To Speed Up Your Divi Website? Find Out How 👇

Get fast WordPress hosting optimized for Divi.

Speed Up Divi
Divi Hosting
Premade Layouts

Check Out These Related Posts

New Starter Site for Yoga (Quick Install)

New Starter Site for Yoga (Quick Install)

Posted on December 20, 2024 in Divi Resources

Divi empowers you to build the best websites possible, and now, Divi Quick Sites takes website creation to a whole new level. This revolutionary tool lets anyone, regardless of skill level, generate a complete website in under two minutes! Divi Quick Sites provides everything you need to launch...

View Full Post
New Starter Site for AI (Quick Install)

New Starter Site for AI (Quick Install)

Posted on December 17, 2024 in Divi Resources

Divi empowers you to build the best websites possible, and now, Divi Quick Sites takes website creation to a whole new level. This revolutionary tool lets anyone, regardless of skill level, generate a complete website in under two minutes! Divi Quick Sites provides everything you need to launch...

View Full Post
Divi 5 Update: Public Alpha Version 5

Divi 5 Update: Public Alpha Version 5

Posted on December 10, 2024 in Divi Resources

The Divi 5 Public Alpha is available for testing. If you use Divi 5, you’ll notice an update notification for Public Alpha Version 5 today. We release new Divi 5 versions every two weeks, and it gets better each time! If you haven’t tested Divi 5 yet, try it and let us know what you...

View Full Post

18 Comments

  1. Hi guys, I have the same question as Richard. Is it possible to disable the overlay effect as I would not like the images clicked on in grid view.
    Many thanx, Tomas

  2. This does not work in Firefox even if you get the CSS using Chrome. Any suggestions?

  3. I was wondering if it was possible to have more than 4 images in the row and if we could disable the overlay effect as I would not like the images clicked on

  4. Hi,

    Let me share what I did now with these: I did this one a bit different:

    You have to add this under the general custom css, not on the gallery plugin.

    GALLERY IMAGES
    .et_pb_gallery_grid .et_pb_gallery_image{
    -webkit-clip-path: polygon(85% 0, 100% 13%, 100% 100%, 15% 100%, 0 86%, 0 0);
    clip-path: polygon(85% 0, 100% 13%, 100% 100%, 15% 100%, 0 86%, 0 0);
    }
    LIGHTBOX IMAGES CONTAINER
    .mfp-figure:after{
    -webkit-clip-path: polygon(85% 0, 100% 13%, 100% 100%, 15% 100%, 0 86%, 0 0);
    clip-path: polygon(85% 0, 100% 13%, 100% 100%, 15% 100%, 0 86%, 0 0);
    }
    LIGHTBOX IMAGES
    img.mfp-img{
    -webkit-clip-path: polygon(85% 0, 100% 13%, 100% 100%, 15% 100%, 0 86%, 0 0);
    clip-path: polygon(85% 0, 100% 13%, 100% 100%, 15% 100%, 0 86%, 0 0);
    }

    Rounded Corners:

    GALLERY IMAGES
    .et_pb_gallery_grid .et_pb_gallery_image{
    border-top-right-radius: 15px;
    -moz-border-radius-topright: 15px;
    -webkit-border-top-right-radius: 15px;
    border-bottom-left-radius: 15px;
    -moz-border-radius-bottomleft: 15px;
    -webkit-border-bottom-left-radius: 15px;
    }
    LIGHTBOX IMAGES CONTAINER
    .mfp-figure:after{
    border-top-right-radius: 150px;
    -moz-border-radius-topright: 150px;
    -webkit-border-top-right-radius: 150px;
    border-bottom-left-radius: 150px;
    -moz-border-radius-bottomleft: 150px;
    -webkit-border-bottom-left-radius: 150px;
    }
    LIGHTBOX IMAGES
    img.mfp-img{
    border-top-right-radius: 150px;
    -moz-border-radius-topright: 150px;
    -webkit-border-top-right-radius: 150px;
    border-bottom-left-radius: 150px;
    -moz-border-radius-bottomleft: 150px;
    -webkit-border-bottom-left-radius: 150px;
    }

    This way when the image opens up in the Lightbox then it also is rounded, I just increased the size of the rounding on these images.

  5. Nice one! It’s working in Chrome. but not in Firefox or Edge?

    • Hey Frank, yea I know FF and Edge can sometimes have issues with clipping masks. Hopefully they address that in their next browser update…I’ll start putting a disclaimer on anything I use with a clipping mask moving forward. I don’t know of a workaround just yet…

  6. The problem with the Divi Gallery is that if you do a speed test with Google, the rating will be super low. I usually get around 35/100 because Google says to optimize the images (my images are all optimized)
    So I had to switch back to the classic WordPress Gallery and got 100/100!
    Can you fix this? And for some reason if I use the Divi Gallery sometimes the pages are so slow that won’t even load all the content. Please do note that my website is optimized and it loads really fast. I use a CDN and get a score of 100/100 pretty much on every single page. So it IS a problem of the plugin not of my website.
    Thanks

  7. Once again I am in love with Gallery module. I was trying to switch my clients from gallery module to custom layout for images, as it allowed me to input more data. Anyways, Josh, its a wonderful tutorial. I am going to try it.

    • Thanks, Hamza! Yep, sometimes a little refresher or new ideas can bring you right back to all the standard Divi modules!

  8. Thanks Josh, so far I’ve avoided using the divi gallery module, but your tutorial series this week has re-inspired me to try again!
    Tomorrow’s tut on having more or less columns is the one I’m so looking forward to!
    Keep up the awesome tutorials, they really do add value.

    • Awesome to hear, Hurri! That is much appreciated. Yes I think the next two tutorials will have you excited to use the Divi Gallery again 🙂

  9. That tool is a godsend and opens up tons of unique possibilities for web design. Thank you for sharing it!

    • Great to hear! Thanks for the feedback!

  10. “No support

    Sorry but the CSS clip-path property does not support basic shapes in Firefox 50. Please try opening this page in another browser.”

    Is there a way to around this aside from using another browser?

    Thanks

  11. Thank you Josh, this is very nice! I notice that this doesn’t seem to work however, if there is a custom gutter width assigned to the row. Not sure why that should affect it but it does. Any work around?

    • I see what you mean, John. Seems to work fine if the gutter is above 1. I’ll look into that!

  12. Big applause to you Josh,

    wow, great work and very clear tutorial!
    Hope to learn and see much more from you.

    • Thanks, Jeroen! Couple more Gallery tutorials coming your way this week!

Leave A Reply

Comments are reviewed and must adhere to our comments policy.

Join To Download Today