[html5] Using <section> and <h1> ? Theoretical?
Jukka K. Korpela
jukka.k.korpela at kolumbus.fi
Wed May 14 12:29:58 PDT 2014
2014-05-14 22:11, Ian Hickson wrote:
> But yes, to support tools that don't yet support <section>, one should
> use <h2>-<h6>. That's why the spec allows this. It was part of the
> original design of <section> and friends, almost 10 years ago now. :-)
And <h2> and friends have worked well even longer. The question is
really why the use of <h1>, relying on support to <section>, is allowed
at all (and often seen as recommended and “more logical”).
Originally, different elements for different levels of headings were
introduced so that even the most primitive user agents could handle them
well. No contextual analysis was needed for selecting suitable font size
and vertical margins, in the old days when CSS was just a dream. But
despite this brutal primitiveness, the heading tags have worked well and
keep doing their job, so why introduce new definitions that confuse many
people but offer no real benefits?
Either <h1> is first level heading or it is something else. The idea
that it might be first level either relative to the page as a whole or
as relative to some enclosing <section> or another element obviously
confuses people. It is even more confusing to say that for a section
heading, you can use either <h1> or <h2>.
The only potential benefit from using <h1> as relative to <section> (or
something similar) is that you can cut and paste, or otherwise copy, a
fragment of an HTML page and put it inside a <section> of another page,
without changing the markup. Does this really justify the confusion?
When re-using a fragment of HTML, this is surely among the trivial
parts. You would need to worry about id attributes being unique, class
attributes not conflicting with classes used on the page otherwise,
elements inheriting CSS properties against the author’s intentions,
script code doing nasty things when included in a new environment, base
address not being what it was expected to be, etc.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
More information about the Help
mailing list