WordPress.org

Support

Support » How-To and Troubleshooting » How to adjust spacing or margins for only a few gallery images?

How to adjust spacing or margins for only a few gallery images?

  • What filters or custom CSS can I use to modify the spacing for just a few images in my wordpress gallery?

    I only need to make a few of the images closer together, not adjust the global spacing, if this is possible.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    @esmi

    Forum Moderator

    Try using Firefox with the Firebug add-on for this kind of work.

    Hi Esmi,

    I do use Firebug, but the problem is that I need to adjust the spacing for just a few images (again, not spacing applied to the whole gallery) and I still want the gallery to be automatically generated.

    Any ideas?

    make a specific CLASS for those images. On that page you have #gallery-1 img, #gallery-2 img, #gallery-3 img …. so whichever set you want to adjust spacing for… you need to add rules too… like… padding or margins etc. … however, I now see this > dl class=”gallery-item” < that is what you need to adjust. Find the #gallery-1 .gallery-item < it’s on line 95. … if that’s what your issue is. You don’t mention exactly what images you want to make closer together.

    @teajavo1
    The gallery is being created with the shortcode below, so I’m not sure how I would add a specific class for two images.

    [gallery link="file" include="214,213,212,215" columns="4"]

    This screenshot shows the two images I’d like to control the margins/padding for. Here’s an updated link to my page with the wordpress gallery.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to adjust spacing or margins for only a few gallery images?’ is closed to new replies.