Kevin Powell - CommunityKP-C
Kevin Powell - Community11mo ago
3 replies
Dev_HK

how to tell on grid break; the last element take full grid col

.our-packs-grid{
    width: clamp(calc(64rem - 4rem),70vw,80rem);
    margin-inline: auto;
    margin-block: 2rem 0;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit,minmax(20rem,1fr)) !important;
}

@media screen and (max-width:64rem){
    .our-packs-grid{
        width: calc(100% - 4rem) !important;
    }
    .our-packs-item-card:last-child:nth-of-type(2n+1){
        grid-column: 1/-1;
    }
}
.our-packs-item-card {
    position: relative;
    max-width: 100%;
    width: 100%;
}


i want the last child that' s oddto take the full columns of the grid columns
image.png
image.png
Was this page helpful?