[whatwg] additional empty elements

Jon Barnett jonbarnett at gmail.com
Tue May 1 13:24:17 PDT 2007


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20070501/410ff9a2/attachment-0001.htm>


More information about the whatwg mailing list