• Resolved jomcd40

    (@jomcd40)


    Hi all,

    For a gallery, I’m using CSS to create 3 columns that layout how I want them on desktop and mobile. It works for most of the galleries except one – which I wanted as 2 columns. I’ve tried using specific CSS for #gallery-4 (the gallery with 2 columns) but its not working. All other galleries on the site are #gallery-2 but randomly the CSS (that someone gave me) is for #gallery-1 but it still works. Hope that makes sense. I’m not a coder!

    Here’s the link and the CSS i’m using is below. Theres more CSS but I don’t think it relates to the gallery. box2beat.co.uk/disability-training/

    box2beat.co.uk/disability-training/

    /* reduce image width to allow spacing */
    .gallery-columns-3 .gallery-item {
        max-width: 31%;
    }
    /* equal spacing between images */
    #gallery-1 {
        display: flex;
        justify-content: space-between;
    }
    .gallery-item {
        margin-top: 0;
        margin-left: 10px;
    }
    #gallery-4
    .gallery-columns-3 .gallery-item {
        max-width: 48%;
    }
    #gallery-4 {
        display: flex;
        justify-content: space-between;
    }
    .gallery-item {
        margin-top: 0;
        margin-left: 10px;
    }
    }

    Any ideas?

Viewing 1 replies (of 1 total)
  • There’s no gallery-4 on the page you’ve linked. I only see gallery-6 and gallery-8.

    Targeting specific galleries by the id probably isn’t the safest way to do this, because these id’s aren’t editable by you, and could change as you add and remove galleries. This is probably why gallery-4 doesn’t appear on the page anymore.

Viewing 1 replies (of 1 total)

The topic ‘Problem appling differnt columns to different galleries’ is closed to new replies.