Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Using CSS to Style UL with 4 or more List Items Re: Using CSS to Style UL with 4 or more List Items

#112335
AntonNiklasson
Participant

This might be helpful: http://lea.verou.me/2011/01/styling-children-based-on-their-number-with-css3/

Otherwise use that jQuery you have there. One thing that might make it easier is to style the ul as it would look with 4 or more li’s in it as default. Then override some css when there’s 3 li’s or less. That way I think you’ll end up with fewer LOC.