[thelist] Re: Hn tags

Paul Cowan evolt at funkwit.com
Mon Jun 24 17:03:00 CDT 2002


Joel wrote:
> How 'bout this: make the <hx> tag an attribute of some kind of div, in
order
> to 'containerize' it. It lets rudy group his content
> structurally/semantically however he sees fit without any conceptual need
> for a rigid heirarchy.

Yep. This is pretty much what (I think) it SHOULD be. If not an attribute,
at least a generic "heading"-type thing, so it still renders in old
browsers -- like table captions. And the whole 'n' part of 'Hn' is a bit of
a hack (well... it wasn't at the time. It certainly is now.)

Something like:

<div>
    <h>Level 1 Heading</h>
    <p>Level 1 text</p>

    <div>
        <h>Level 2 Heading</h>
        <div>
            <h>Level 3 Heading</h>
            <p>Level 3 text</p>
        </div>
        <p>Level 2 text which currently can't really be conveyed</p>
    </div>

    <h>Another Level 1 Heading</h>
    <p>More level 1 text</p>
</div>

Which could then be styled like
    div > h {
        font-size: enormous;
    }

    div > div > h {
        font-size: pretty_damn_big;
    }

    div > div > div > h {
        font-size: biggish;
    }

    div > div > div > div > h {
        font-size: normal;
        font-weight: bold;
    }

Or something like that. Not a perfect example, not the least because "div"
carries a lot of baggage. But you get the idea.

Paul.




More information about the thelist mailing list