php $count - Undefined variable:

后端 未结 2 720
-上瘾入骨i
-上瘾入骨i 2021-01-22 15:35

I have this code that I want to insert a div clear class the it reaches the 5th column:

\"> <
2条回答
  •  孤城傲影
    2021-01-22 16:02

    It is better to do that with CSS and not with markup or server side scripting. Let me give you an example:

    .grid:nth-child(5n+5), .grid.fifth-child { clear: both; }
    

    It's not supported in every browser so you can use jQuery to fix that:

    $('.grid:nth-child(5n+5)').addClass('fifth-child');
    

提交回复
热议问题