I have used CSS flex and width to design a list, and now I want to apply background colors to every 3 list items after the 3rd item. However, I would like the colors to appear in pairs of 2. I have attempted to achieve this using the CSS Pseudo Class :nth-child(), but have not been successful.
Important: The design was created using only HTML and CSS.
| 1 || 2 || 3 |
|--4---||--5---||--6---| --- Green Background Color
| 7 || 8 || 9 |
|--10--||--11--||--12--| --- Red Background Color
| 13 || 14 || 15 |
|--16--||--17--||--18--| --- Green Background Color
| 19 || 20 || 21 |