I am wondering if there is a CSS selector that would auto-magically target the last div on a row created by either flexbox or floats.
In our particular use, we have an image grid with different width images. In its full width, there are rows with 3 images (each 33%) and rows with 2 images (50/50 or 60/40). When viewed with a vertical tablet all images change to 50% and it is two per row, on a phone 100%. All of the images are within a single overall container, not row containers (because of the three becoming two).
Like many grid type layouts we have a 2% margin-right, that needs to be reset to 0 on the right most div.
Currently using the traditional "last" class to remove the margin manually and a pseudo :nth-child(odd) to manipulate the vertical tablet layout. I am playing with two variations, one using floats and one using flexbox.
Is there a single css selector that would target the last div in each case?
Expanding on layouts:
On full sized monitor
|img1 - 33%|2%|img2 - 33%|2%|img3 - 33%|
|img4 - 40%|2%|img5 - 60%|
|img6 - 33%|2%|img7 - 33%|2%|img8 - 33%|
On a vertical tablet
|img1 - 50%|2%|img2 - 50%|
|img3 - 50%|2%|img4 - 50%|
|img5 - 50%|2%|img6 - 50%|
|img7 - 50%|2%|img8 - 50%|
On phone
|img1 - 100%|
|img2 - 100%|
|img3 - 100%|
|img4 - 100%|
etc
ps I know my percentages do not add up.