A question about XHTML 2.0

Discussion in 'HTML' started by John Salerno, Feb 2, 2006.

  1. John Salerno

    John Salerno Guest

    Don't shoot me for asking, please! :)

    I was reading about the aims for XHTML 2.0 and I noticed that instead of
    having h1-h6 elements, they will use <section> and <h> elements to
    better structure the content. But I was wondering, if you use this
    method, how would it be possible to style nested <h> elements within a
    section? Example from an XHTML 2 document:

    <body>
    <h>Events</h>
    <section>
    <h>Introduction</h>
    <p>....</p>
    <h>Specifying events</h>
    <p>...</p>
    <section>
    <h>Attaching events to the handler</h>
    <p>...</p>
    </section>
    <section>
    <h>Attaching events to the listener</h>
    <p>...</p>
    </section>
    <section>
    <h>Specifying the binding elsewhere</h>
    <p>...</p>
    </section>
    </section>
    </body>

    Will all of the <h> elements look the same? Or does their appearance
    depend on how far inside a section they are? I doubt the latter. But if
    CSS is used to style them, how do you distinguish between the different
    ones if they are all <h>? It doesn't seem convenient to have to give
    them all ids or classes.
     
    John Salerno, Feb 2, 2006
    #1
    1. Advertising

  2. John Salerno

    Mark Parnell Guest

    Deciding to do something for the good of humanity, John Salerno
    <> declared in alt.html:

    > But I was wondering, if you use this
    > method, how would it be possible to style nested <h> elements within a
    > section?


    The same as you style nested elements now.

    > Will all of the <h> elements look the same?


    I wouldn't think so.

    > Or does their appearance
    > depend on how far inside a section they are?


    You mean how far down they are nested? Or how much other content is
    between <section> and <h>? If the former, the answer is yes.

    > But if
    > CSS is used to style them, how do you distinguish between the different
    > ones if they are all <h>?


    h {...}
    h h {...}
    h h h {...}
    etc.

    > It doesn't seem convenient to have to give
    > them all ids or classes.


    Depending on the structure of your pages, it can be useful to have ids
    on all your headings to allow linking directly to them. But no, there's
    not much point purely for styling purposes.

    --
    Mark Parnell

    I give up:
    http://blinkynet.net/comp/uip5.html
     
    Mark Parnell, Feb 2, 2006
    #2
    1. Advertising

  3. John Salerno <> wrote:

    > I was reading about the aims for XHTML 2.0 and I noticed that
    > instead of having h1-h6 elements, they will use <section> and <h>
    > elements to better structure the content.


    Yes. I hope you noted that XHTML 2.0 is just a working draft (and not
    even a complete draft), and it will probably take years before it
    becomes a specification and a recommendation (if that ever happens).

    > But I was wondering, if
    > you use this method, how would it be possible to style nested <h>
    > elements within a section?


    You would use contextual selectors in CSS. Even in existing CSS, you
    could use e.g.
    h { font-size: 150%; }
    section h { font-size: 130%; }
    section section h { font-size: 110%; }

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Feb 2, 2006
    #3
  4. John Salerno

    cwdjrxyz Guest

    John Salerno wrote:
    > Don't shoot me for asking, please! :)
    >
    > I was reading about the aims for XHTML 2.0 and I noticed that instead of
    > having h1-h6 elements, they will use <section> and <h> elements to
    > better structure the content. But I was wondering, if you use this
    > method, how would it be possible to style nested <h> elements within a
    > section? Example from an XHTML 2 document:


    Have fun, and each to their own. I do true xhtml 1.1. However xhtml 2
    is not yet final, new browsers likely will be required for some of it,
    and it is not yet included at the W3C validator. Thus I plan to wait
    until something is at least final, there is final validator to check
    your code, and there are browsers available to take full advantage of
    it. But then, there are likely some who will find the study of xhtml 2
    at this stage more interesting than doing a crossword puzzle, and
    likely it will be more useful. Just now, likely most people would find
    more practical use from learning more about codes that will help at
    present. For example learning more PHP, Javascript, and possibly Perl
    would benefit many. If that is not enough, there are all sorts of
    things you can do on a server if you learn Java and C++ well.
     
    cwdjrxyz, Feb 2, 2006
    #4
  5. John Salerno

    Mark Parnell Guest

    Deciding to do something for the good of humanity, Mark Parnell
    <> declared in alt.html:

    > h {...}
    > h h {...}
    > h h h {...}


    Duh, I was thinking headers nested within headers. See Jukka's post...

    *rolls eyes*

    --
    Mark Parnell

    I give up:
    http://blinkynet.net/comp/uip5.html
     
    Mark Parnell, Feb 2, 2006
    #5
  6. John Salerno

    John Salerno Guest

    cwdjrxyz wrote:

    > Have fun, and each to their own. I do true xhtml 1.1. However xhtml 2
    > is not yet final, new browsers likely will be required for some of it,
    > and it is not yet included at the W3C validator. Thus I plan to wait
    > until something is at least final, there is final validator to check
    > your code, and there are browsers available to take full advantage of
    > it. But then, there are likely some who will find the study of xhtml 2
    > at this stage more interesting than doing a crossword puzzle, and
    > likely it will be more useful. Just now, likely most people would find
    > more practical use from learning more about codes that will help at
    > present. For example learning more PHP, Javascript, and possibly Perl
    > would benefit many. If that is not enough, there are all sorts of
    > things you can do on a server if you learn Java and C++ well.
    >


    Oh, I definitely don't plan to learn it right now! I just finished
    getting comfortable with HTML/XHTML/CSS (and now I have XHTML 1.1 to
    scare me). I was just curious about how the <h> is handled. I figured it
    might be something like Jukka's example, but that seems so much messier than

    h1 { something }
    h2 { something }
    etc...

    And yet it also seems a lot cleaner...go figure...
     
    John Salerno, Feb 2, 2006
    #6
  7. Gazing into my crystal ball I observed John Salerno
    <> writing in
    news:Y6pEf.1523$:

    > I figured it
    > might be something like Jukka's example, but that seems so much messier
    > than
    >
    > h1 { something }
    > h2 { something }
    > etc...
    >
    > And yet it also seems a lot cleaner...go figure...
    >


    Well, you could always write and voice your opinion:
    "Public discussion may take place on (archive). To
    subscribe send an email to with the word
    subscribe in the subject line."

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Feb 4, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    7
    Views:
    900
  2. chronos3d
    Replies:
    9
    Views:
    786
    Andy Dingley
    Dec 5, 2006
  3. Usha2009
    Replies:
    0
    Views:
    1,140
    Usha2009
    Dec 20, 2009
  4. xhtml champs
    Replies:
    0
    Views:
    537
    xhtml champs
    Aug 1, 2011
  5. xhtml champs
    Replies:
    0
    Views:
    1,044
    xhtml champs
    Aug 2, 2011
Loading...

Share This Page