Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Using ~ and + selectors for conditional php loop Reply To: Using ~ and + selectors for conditional php loop

#146572
Senff
Participant

If you are looking for something like this setup, why not just add some right-margin to the image?

http://codepen.io/senff/pen/FEpxG

But, if you must target the elements next to the IMG, you can’t use the ~ sign because that will target ALL elements that come after any IMG (which, basically, is everything in the document). You’d have to wrap every block in a separate DIV to achieve that:

http://codepen.io/senff/pen/vJhsD