Responsive WordPress galleries with column-count

I have been working on customizing the gallery shortcodes generated by WordPress with column-count CSS. I was having issues with margin-bottom pushing from one column into the next and am now using padding-bottom on the img element itself, which is inside the block-level figure element and thus just adds to the figure height. As far as I can tell, this is a problem-free solution, but I am new to using column-count and want to check if I’m doing this right. What do you think?

Here is the simplified code on Codepen: https://codepen.io/davideg/pen/PmWzwW

Read more here: Responsive WordPress galleries with column-count

Leave a Reply

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