I got the problem that I got a variable amount of child-elements.
My :last-child :first-child rules should only apply, when there are at least 3 children
I tried :only-child, which can overwrite :last- and :first-child when there is only 1 child, but when I got 2 children, I have a problem. Is there some sort of selector, that only applies, when there are more children than n?
Use the
:nth-child(n+3)selector (where 3 is the nth minimum child).Demo: http://jsfiddle.net/vCZ9A/