A question about XHTML 2.0

J

John Salerno

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.
 
M

Mark Parnell

Deciding to do something for the good of humanity, John Salerno
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 said:
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.
 
J

Jukka K. Korpela

John Salerno said:
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%; }
 
C

cwdjrxyz

John said:
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.
 
M

Mark Parnell

Deciding to do something for the good of humanity, Mark Parnell
h {...}
h h {...}
h h h {...}

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

*rolls eyes*
 
J

John Salerno

cwdjrxyz said:
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...
 
A

Adrienne Boswell

Gazing into my crystal ball I observed John Salerno
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 (e-mail address removed) (archive). To
subscribe send an email to (e-mail address removed) with the word
subscribe in the subject line."
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top