Kevin Powell - CommunityKP-C
Kevin Powell - Community2y ago
4 replies
max

Why aren't these grid elements moving next to each other?

I'm using the following scheme in a 3-column grid layout:
    img:nth-of-type(2n-1) {
        grid-column: 3;
    }
    img:nth-of-type(2n) {
        grid-column: 1;
    }
    article:nth-of-type(2n-1) {
        grid-column: 1 / 3;
        padding-right: 4rem;
    }
    article:nth-of-type(2n) {
        grid-column: 2 / 4;
        padding-left: 4rem;
    }

Articles are the text blocks seen in the image.
image.png
Was this page helpful?