Source: https://www.elegantthemes.com/forum/viewtopic.php?f=187&t=573199
A Divi gallery with 4 images in a row.
- On iPad portrait, it shows a row with 3 and a row with 1 image rather then 2 / 2
- On iPhone 6 Plus, there is a border on the right
/* -- START Fix responsive issues for gallery with 4 images at the bottom of each page -- */
@media (max-width: 980px) and (min-width: 479px) {
.et_pb_gallery .et_pb_grid_item:nth-child(n) {
width: 50% !important;
clear:none;
}
.et_pb_gallery .et_pb_grid_item:nth-child(n) img {
width:100%;
}
.et_pb_gallery .et_pb_grid_item:nth-child(2n+1) img {
clear:both !important;
}}
.et_pb_gallery .et_pb_grid_item:nth-child(n) img {
width:100%;
}
/* -- END Fix responsive issues for gallery with 4 images at the bottom of each page -- */Code language: CSS (css)
To show other/multiple columns on different breakpoints: