[Resolved] How to Adjust WordPress Gallery Margin Padding?

Home Forums Support [Resolved] How to Adjust WordPress Gallery Margin Padding?

Home Forums Support How to Adjust WordPress Gallery Margin Padding?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1161497
    bluebit

    The wordpress gallery I think adds top and bottom margin padding between the gallery images and the top and bottom blog post text, how can I reduce that padding?

    #1161655
    David
    Staff
    Customer Support

    Hi there,

    do you want to remove spacing (gutters) between images

    or the spacing above and below

    or both ?

    #1161710
    bluebit

    just the spacing above and below, I just want to decrease it by 1px on the top and bottom

    #1161724
    David
    Staff
    Customer Support

    Ok so to cover the bases:

    1. The space above the gallery ie. between the line of text and the gallery is actually the bottom margin on the paragraph. You can reduce the globally in Customizer > Typograpghy > Body

    2. The space below the gallery this CSS:

    .site-main .gallery {
        margin-bottom: 25px;
    }

    3. Spacing around each image:

    .gallery-item .gallery-icon {
        padding: 5px 5px;
    }

    The first 5px is the value for the top and bottom, and the other 5px is for the left and right.

    #1161998
    bluebit

    Ok, I did:

    .site-main .gallery {
    margin-bottom: 10px;
    }

    For the bottom, and that’s worked.

    Also, I also tried this for the top:

    .site-main .gallery {
    margin-top: 10px;
    }

    But the this top code doesn’t work.

    #1162004
    bluebit

    I think its the gallery doing it, let me change it real quick.

    #1162014
    bluebit

    yep, I think I got it to work with this code:

    .gallery-item .gallery-icon {
    padding: 0px 5px 10px 5px;
    }

    Thank You

    #1162033
    David
    Staff
    Customer Support

    Glad to hear that 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.