4 ms·
You can use nth-child/nth-last-child for much more than table even/odd styling. It can be used to style children based on the number of siblings they have, buil
by mmastrac 12y ago
You can use nth-child/nth-last-child for much more than table even/odd styling. It can be used to style children based on the number of siblings they have, build grids out of list items, or style grid interval tick marks on a timeline off the top of my head.
- err4nt 12y agoA cleaner way of targeting elements with a specific number of children exists using EQCSS for Element Queries: @element '.sidebar' and (max-children: 5) { .widget h3 { font-size: 125%; } } Check out the min-children/max-children examples on: http://elementqueries.com/test.html http://elementqueries.com/test.html