I have multiple items with same width inside a container. Because of different heights of the elements, there is problem with the alignment, you can see in image below.
You should use nth-child(3n+1) so that it happens at each child following a child multiple by 3, not only at the first 3rd child.
nth-child(3n+1)
Then, you should remove that :after, you want to clear the actual child.
:after