Hide a .gif if it is beside another .gif
I have a service where people can upload their images, and I display them on my website. I want to automatically hide a
.gif if it is uploaded beside another
I don’t want this to effect images ending in
Here is an image example..
If there are three
.gifs in a row, only display the first one.
I have tried selecting it, and hiding it, but this doesn’t work at all.
This will set
display:none; on any
gifs immediately following a
.gif. Therefore no more than two
.gifs will ever appear beside each other.
1Usage of the attribute selector and direct adjacent combinator are not fully supported by IE8 and down.