WordPress.org

Ready to get started?Download WordPress

Forums

Trying to add padding to gallery images (5 posts)

  1. Little Laura
    Member
    Posted 10 months ago #

    http://www.creaturecomfortsofbalto.com

    The pics would look so much nicer with 5% padding, but what I tried isn't working:

    #gallery-1 img {
        border: 2px solid #CFCFCF;
    }
    #gallery-1 img {
    
    }
    .gallery .gallery-icon img {
        padding: 5%;
    }

    Any suggestions?

    Very thankful!

  2. wen.wainwright
    Member
    Posted 10 months ago #

    Try this:

    dl.gallery-item:nth-child > dt:nth-child(1) {
    padding-left: 5%;
    padding-right: 5%;
    }

    This is the same thing as above:

    dl.gallery-item:nth-child > dt:nth-child(1) {
    padding: 0 5% 0 5%;
    }

    I'm not familiar with the theme you are using but you might also need to look at the size of the images. The padding won't really be noticeable if the images have a set size. I assume you want the images to be closer together but not scrunched up in the middle of the page? It's hard to lessen the space between them if the size is being constrained somewhere else.

  3. Little Laura
    Member
    Posted 10 months ago #

    What I mean is I would like each picture to have a nice little border around it to show it off, just as photos appear in the gallery page of a Twenty Twelve theme, but in the rather simpler Misty Lake theme that I have chosen. I'd like them to have a 5% padding of white around them and then the gray 2 pix border around that.

    Sorry I wasn't clear and thank you for answering!

  4. wen.wainwright
    Member
    Posted 10 months ago #

    If you want to add a border around them then you need to add a border style. Since it's the same element try:

    dl.gallery-item:nth-child > dt:nth-child(1) {
    border: 5% solid #ccc;
    }

    I'm not sure if using the percent for the border will work very well but you can try it with pixels if it doesn't work.

  5. Little Laura
    Member
    Posted 10 months ago #

    Thanks for the suggestions; tried both what you pasted and with pixels; still not getting the results to appear. (Also tried things I found on a CSS tutorial. I think what I was calling padding I should have been referring to as margins for the photos - between the photo and the border.) But my problem may be in not having the right name for the id. I don't know... I'm at a loss.

    I'm going to try submitting this request for help properly under its theme name and see if someone familiar with the theme might be able to help.

    Anyway, thanks thinking with me about this.

Reply

You must log in to post.

About this Topic