css selectors - :nth-child(3n):after cleafix not working in CSS -


hello there have tried following think should valid css , not work (tested google chrome).

<ul> <li><a href="...">bla</a></li> <li><a href="...">bla</a></li> <li><a href="...">bla</a></li> <li><a href="...">bla</a></li> <li><a href="...">bla</a></li> </ul> 

the css:

ul li {     float:left; }  ul li:nth-child(3):after {     content:"";     display:table;     clear:both; } 

the floating list elements should start new row after each third element in list within responsive design. have solution suggestion? isnt supposed work?

just apply below.

 ul li:nth-child(4n) {clear:both;} 

demo


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -