[html5] Using <section> and <h1> … Theoretical?

Micky Hulse mickyhulse.lists at gmail.com
Sun Jun 1 13:49:24 PDT 2014


Hi Lewis,

I think that Ian's comments convey that one can use both approaches. The
WHATWG specs show both types of approaches as valid examples.

It's the W3C spec that's now recommending people **not** use the "h1 only"
approach for the sake of AT (assistive technology) and browsers (as they do
not, yet, implement/expose any sort of outline algorithm; i.e., they see
the H1s as top-level no matter the parent tag).

Looks like Steve posted a pretty good WIKI page link that explains the W3C
point of view (or, facts).

One can still use the "h1 only" approach, but you could be creating
problems for yourself as far as AT and browsers are concerned.

With that said, I kinda like to think that the "h1 only" approach is like
"coding for the future". The problem is, apparently, as Steve has pointed
out, the HTML5 outliner has been around for ~10 years and hasn't been fully
implemented in any popular browsers or AT software.

In other words, we can still use the "h1 only" and just hope that one day a
browser/AT device will support the way the HTML5 outliner sees the
structure of the document (i.e., code for the future, but no one knows when
that future will arrive).

At least, that's how I understand the situation based on discussions we've
had on this list.

Hopefully that helps to summarize. Anyone, please correct me if my summary
is wrong or missing something.

Cheers,
M



On Sun, Jun 1, 2014 at 8:33 AM, Lewis Dexter Litanzios / ldexterldesign <
mail at ldexterldesign.co.uk> wrote:

>  Hey Ian,
>
> Your suggestion makes writing *portable* mark-up difficult, which I
> thought we were moving away from with the introduction of sectioning elems?
>
> For example I could create the following mark-up in one section of my
> website and use it on another page, where the heading may need to be a h2
> instead of a h1:
>
> <section>
>     <h1>Heading</h1>
>     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minus,
> tempore, dolorum, beatae a repudiandae obcaecati officia placeat ab iusto
> vero nobis eveniet distinctio dolor totam laborum recusandae dolore
> repellat eos.</p>
> </section>
>
>
> ... rather than simply using h1 site wide and knowing where ever I include
> it - providing it's sectioned - my mark-up snippet will nest nicely into a
> sensible document outline, I now have to worry about heading details :/
>
> Where can I reference browser support for outline algorithm - I did think
> it came with the html5 doctype?!
>
> Thanks,
>
>
> On 12/05/2014 23:36, Ian Hickson wrote:
>
> On Fri, 9 May 2014, Micky Hulse wrote:
>
>  Ok, so, W3C is changing the language, but what is WHATWG doing (or, have
> plans to do)?
>
>  As you pointed out, some people are "hating" on <section> and <h1> and so
> on. It's not really clear to me why; the concerns haven't really been well
> explained IMHO. There's no plan to change any of this in the WHATWG spec.
> (I'm especially confused because this style actually comes from XHTML2,
> which was championed by the W3C.)
>
> One thing to bear in mind is that in legacy browsers that don't support
> style sheets, and in some accessibility tools that haven't yet been
> updated to match the HTML spec, the "<section>" elements are "invisible"
> (unknown, treated like <div>). This leads to the <h1>s being treated as
> page headers in those UAs. To avoid this problem, while we wait for
> support to be more widely available, my recommendation is to use <h2>-<h6>
> with <section>, as in:
>
>    <h1>...</h1>
>    <section>
>     <h2>...</h2>
>     <section>
>      <h3>...</h3>
>      ...
>
> ...instead of:
>
>    <h1>...</h1>
>    <section>
>     <h1>...</h1>
>     <section>
>      <h1>...</h1>
>      ...
>
> The spec defines these as semantically identical, precisely to enable this
> transition period. We'll be able to use the <section>/<h1> style without
> even this trouble eventually. If you're not interested in targetting those
> browsers (e.g. you're just writing something for your own use) then I
> wouldn't worry about any of this.
>
>
>
> --
>  ldexterldesign
>  [image: ldexterldesign logo] <http://www.ldexterldesign.co.uk/>
> Lewis Dexter Litanzios
> Web Designer & Developer
> mail at ldexterldesign.co.uk
> +44 7504 907 304
>
> _______________________________________________
> Help mailing list
> Help at lists.whatwg.org
> http://lists.whatwg.org/listinfo.cgi/help-whatwg.org
>
>


-- 
<git.io/micky>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/help-whatwg.org/attachments/20140601/73fcf634/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo-ldexterldesign-black-150x.png
Type: image/png
Size: 3580 bytes
Desc: not available
URL: <http://lists.whatwg.org/pipermail/help-whatwg.org/attachments/20140601/73fcf634/attachment.png>


More information about the Help mailing list