<Hx> tags usage

N

Noozer

Just wondering what the proper usage is for heading tags.

Is it proper to start using <h3> if you haven't used an <h1> or <h2> tag?

Should the first heading tag always be <h1> and styled as necessary, then
<h2> for the subheadings under <h1>, etc... Or, do you start with the closes
matching <h> tag and style only what needs to be changed?

Also, does it matter if there are unrelated areas on the page using
headings? (for example, a menu area with a main heading followed by category
subheadings and then another area on the page with a results heading
followed by sections with headings.)
 
M

Mitja

Noozer said:
Just wondering what the proper usage is for heading tags.

Is it proper to start using <h3> if you haven't used an
<h1> or <h2> tag? Nope.

Should the first heading tag always be <h1> and styled as
necessary, then <h2> for the subheadings under <h1>,
etc... Or, do you start with the closes matching <h> tag
and style only what needs to be changed?
The first.
Also, does it matter if there are unrelated areas on the
page using headings? (for example, a menu area with a
main heading followed by category subheadings and then
another area on the page with a results heading followed
by sections with headings.)
I'm not sure I got this right, but I think what you're describing makes sense. A menu is, after all, one of the main sections on
every page. A special section admittedly, but still, the word "menu" is structurally closer to a heading than, say, a paragraph.
 
D

David Dorward

Noozer said:
Just wondering what the proper usage is for heading tags.

Is it proper to start using <h3> if you haven't used an <h1> or <h2> tag?

That depends on your POV, the specification isn't clear. Most experts are in
agreement that H1 is a heading, H2 is a subheading, H3 is a subsubheading
and so on - so it wouldn't make sense to start with H3.
Should the first heading tag always be <h1> and styled as necessary, then
<h2> for the subheadings under <h1>, etc... Or, do you start with the
closes matching <h> tag and style only what needs to be changed?

Closest matching? You are forgetting that the default rendering is little
more then coincidence.
Also, does it matter if there are unrelated areas on the page using
headings? (for example, a menu area with a main heading followed by
category subheadings and then another area on the page with a results
heading followed by sections with headings.)

Again, a matter for debate. Personally I prefer to avoid it given the
results when you take the headings out of context
<http://www.w3.org/2003/12/semantic-extractor.html>. IMO if you have
navigation that complicated, then you should look at simplifying it.
 
A

Andy Dingley

Just wondering what the proper usage is for heading tags.

There is none. Zilch. Nada.

Maybe there is. In some contexts there certainly is - many authoring
standards etc want to seem a simple tree structure, no skipped levels,
only one <h1> and so on. But in _HTML_ there is no requirement on
ordering them.

Do what you like. Be "sensible" with them, according to some standard
that keeps you happy. But it is definitely not "incorrect" to jumble
them.

The only real authoratitve guide is (as ever) here:
http://www.w3.org/TR/html4/struct/global.html#edef-H1
 
J

John Brandt

People using certain Assisitive Technology (screen readers and the
like) can set the device to read only H1, H2, etc. They use this as a
means for "skimming." Using the H's out of order will created a
confused and less accessible webpage.

jeb
 
N

Nick Theodorakis


<groping for counterexample> Perhaps when one is writing a page that
is a continuation of a long article, then one might skip from <h1> to
<h3> or lower. Although personally, I generally prefer that long
articles are delivered to me as one page.

Nick
 
N

Neal

<groping for counterexample> Perhaps when one is writing a page that
is a continuation of a long article, then one might skip from <h1> to
<h3> or lower.

This presumes the article has been split at a non-major section, which is
unwise. If the h2 section is ongoing, IMO h2 should be restated on the new
page.
 
J

Jukka K. Korpela

<groping for counterexample> Perhaps when one is writing a page that
is a continuation of a long article, then one might skip from <h1> to
<h3> or lower.

Maybe a more logical counterexample:

<blockquote>
<h1>Hello world</h1>
<div title="content omitted from quotation">– –</div>
<h3>Bla bla bla</h3>
<p>Foo bar.</p>
</blockquote>

You would be quoting an external document, omitting some part thereof, so
that only content relevant for the purpose of quoting is present.

Browsers (or indexing robots or table of content generators or other
software) should not be expected to cope with this well. But here the
main problem is that they don't really understand <blockquote>.
If <blockquote> really means block quotation, it should effectively open
a new context, corresponding to embedding an external document.

So in practical terms, we might be more or less forced to use illogical
markup in such situations, e.g. deflating h1 to h4 and h3 to h6 for
example, if the block quotation appears under a h3 heading.
 
T

Toby Inkster

Nick said:
<groping for counterexample> Perhaps when one is writing a page that
is a continuation of a long article, then one might skip from <h1> to
<h3> or lower.

Page 1:
<h1>The Foo Bar FAQ</h1>
<h2>Foo</h2>
<h3>What is Foo?</h3>
<h3>Where is Foo?</h3>
<h3>Why is Foo?</h3>

Page 2:
<h1>The Foo Bar FAQ (cont'd)</h1>
<h2>Foo (cont'd)</h2>
<h3>What has that got to do with Hong Kong Fooey?</h3>
<h2>Bar</h2>
<h2>Can you buy Foo in a Bar?</h2>
Although personally, I generally prefer that long articles are
delivered to me as one page.

Ditto, or that one is offered the choice -- depending I guess on the
length of the document and how much I intend to read.
 
N

Noozer

Noozer said:
Just wondering what the proper usage is for heading tags.

Is it proper to start using <h3> if you haven't used an <h1> or <h2> tag?

Thanks all!

The replies made sense... I know it's not a BIG issue, but still worth
considering.
 
D

DU

Noozer said:
Just wondering what the proper usage is for heading tags.

Is it proper to start using <h3> if you haven't used an <h1> or <h2> tag?

No. And iso-HTML (iso 15445) requires that headings start with <h1>,
that the document respects logical orders of headings otherwise this
will be reported as validation errors.
There are reasons for this. Assistive technologies rely on such order.
Overall editorial conventions of printed documents (newspapers, books,
magazines) follow such rules too.

DU
 
K

Kris

Just wondering what the proper usage is for heading tags.

There is none. Zilch. Nada.[/QUOTE]

There is. ISO HTML tells you you must start with H1 and not skip any
levels. This is actually a real standard.
 
N

Neal

There is none. Zilch. Nada.

There is. ISO HTML tells you you must start with H1 and not skip any
levels. This is actually a real standard.[/QUOTE]

... if you code to ISO. If you don't, it's irrelevent.
 
A

Andy Dingley

There is. ISO HTML tells you you must start with H1 and not skip any
levels. This is actually a real standard.

Yes, but it's an ISO standard and they smell.


Our weapon is unswerving allegiance to the W3C !
 
J

Jukka K. Korpela

Andy Dingley said:
Yes, but it's an ISO standard and they smell.

Our weapon is unswerving allegiance to the W3C !

.... and her mighty state of Xhysteria. And the W3C virtually ridicules
structured use of headings as nitpicking:

"Some people consider skipping heading levels to be bad practice. They
accept H1 H2 H1 while they do not accept H1 H3 H1 since the heading level
H2 is skipped."
http://www.w3.org/TR/html4/struct/global.html#edef-H1

As usual, the HTML 2.0 specification (oddly hosted by the W3C in a
primitive hypertext format) is a great improvement over its successors:

"The six heading elements, H1 through H6, denote section headings.
Although the order and occurrence of headings is not constrained by the
HTML DTD, documents should not skip levels (for example, from H1 to H3),
as converting such documents to other representations is often
problematic."
http://www.w3.org/MarkUp/html-spec/html-spec_5.html#SEC5.4

Note the lack of misleading babble about "importance" there.
 
N

Neal

"Some people consider skipping heading levels to be bad practice. They
accept H1 H2 H1 while they do not accept H1 H3 H1 since the heading level
H2 is skipped."
http://www.w3.org/TR/html4/struct/global.html#edef-H1

This is a set-off note to the section on headings, in fairness to the
reader.
...
"The six heading elements, H1 through H6, denote section headings.
Although the order and occurrence of headings is not constrained by the
HTML DTD, documents should not skip levels (for example, from H1 to H3),
as converting such documents to other representations is often
problematic."
http://www.w3.org/MarkUp/html-spec/html-spec_5.html#SEC5.4

Actually, these together are very illustrative. I tend to try to see the
HTML4 explanations with an eye for history, seeing them as written by, and
for, people familiar with the earlier recommendations.
Note the lack of misleading babble about "importance" there.

.... which we see in the 3.2 recommendation...

"H1, H2, H3, H4, H5 and H6 are used for document headings. You always need
the start and end tags. H1 elements are more important than H2 elements
and so on, so that H6 elements define the least important level of
headings."
http://www.w3.org/TR/REC-html32#headings

.... as well as in the 4.01 you quoted above.

To me, this implies that headings were originally intended in terms of
"level" - the H1 was the most encompassing heading on the page, H2 the
next after, etc. Later, they got wishy-washy and allowed for the headings
to be used out of typical term-paper order - as the original internet was
mainly academic papers, it would make sense to follow academic procedures,
but they are now nodding toward the more commercial aspects of the
internet.

Me, I prefer following a very strict ordering of headings. One H1 per
page. The page is divided up into H2's, allowing for a prolog before the
first H2. H2 sections can be similarly divided up into H3's.

But, it would seem that, although this method is very usable and works
well in any situation, the W3C have pandered to the average author who
knows nothing of the history of the internet.

I'd characterize that as sad, but is it? Perhaps not. Perhaps strict
adherance to ordered headings is not a necessity of a good web page. Until
I am convinced of that, though, I'll continue using strict ordering of my
headings.
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top