I have a webpage layout where there are rows of 3. I need to gove the middle item a special css class. How to do that?
div [div] div
div [div] div
div [div] div
div [div] div
I know with table rows you can get alternating row colors using the ternary operator to detect them:
class="<?= $key % 2 == 0 ? 'odd' : 'even'"
but how to do it for the 2nd in a row of 3?
P.S. I am awful at math, perhaps the answer is quite obvious.