This is the HTML I need to use:
-
You can try something like this. Your pattern is repeating each 4 elements so you need to consider nth-child(4n + x)
:
.images {
display:flex;
min-height:100vh;
flex-wrap:wrap;
align-content:flex-start;
}
.image {
height:50px;
border:1px solid;
box-sizing:border-box;
}
.image:nth-child(4n+1),
.image:nth-child(4n+4) {
width:40%;
background:red;
}
.image:nth-child(4n+2),
.image:nth-child(4n+3) {
width:60%;
background:blue;
}