php while loop variable for every third div

后端 未结 4 464
再見小時候
再見小時候 2020-12-10 16:23

Is their a way in a while loop to assign a variable to a class in a div, for every third item in a while loop. I am using the blueprint structure and the third div is at the

4条回答
  •  庸人自扰
    2020-12-10 17:28

    If you want to do this on the client-side it can be done with CSS3 (add JS for older browsers [DOMAssistant + Selectivizr]).

    CSS: div.imageBorder:nth-child(3n) { /* style attributes will be applied to every 3rd div */ }

提交回复
热议问题