If you're marking up stuff as a tree, the markup should probably look like a tree: <section id="tree">First group <div>Second Group <div>Third Group</div> </div> </section>
if what you want it a tree, that structure is better, so the CSS would simply say: #tree, #tree div { margin-left: 5em; } If you want to style each level differently, that's still easy to do without making up class names: #tree { background: blue; } #tree > div { background: green; } #tree > div > div { background: yellow; } Child selectors are not supported by IE6, but I believe they are by IE7 and every other browser.