Reputation: 331
Is there an easy/elegant way in which to increasingly indent something using CSS?
Example, ul with five li and each one is 1 EM indented more than the one just above it? It seems like nth child could help but I'd like to keep support for IE8.
I know that I could assign IDs to each li but that doesn't seem very efficient...
Thanks!
Upvotes: 2
Views: 262
Reputation: 174957
No, that can't be done with CSS alone cleanly.
You'll have to leverage JavaScript, loop through the li
s and calculate the indentation for each.
Upvotes: 2