How to adjust spacing or margins for only a few gallery images? (5 posts)

  1. mtphoto
    Posted 4 years ago #

    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.

  2. esmi
    Forum Moderator
    Posted 4 years ago #

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

  3. mtphoto
    Posted 4 years ago #

    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?

  4. teajayo1
    Posted 4 years ago #

    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.

  5. mtphoto
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic