W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2010

[whatwg] Should default styles for h1-h6 match the outlining algorithm?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 29 Apr 2010 17:37:04 -0700
Message-ID: <q2mdd0fbad1004291737u6c689a47uf3cf0b76f9b94c51@mail.gmail.com>
On Thu, Apr 29, 2010 at 11:26 AM, L. David Baron <dbaron at dbaron.org> wrote:
> http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#headings-and-sections
> defines an outlining algorithm that gives each heading an outline
> depth that doesn't necessarily match its h1-h6 number (at least as I
> understand it, although I admit I haven't read the details).
>
> There's been a bit of discussion at various times on www-style and
> in other places about adding selectors that would allow CSS to match
> on HTML's outline depth.
>
> However, I was somewhat surprised to see that the rendering section
> http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#fonts-and-colors
> suggests default styles for h1-h6 that don't reflect the outline
> depth at all. ?Should it?
>
> Is the design of the outline algorithm in HTML5 intended to result
> in better default styles for headings?
>
> Or is it expected that the default styles are generally wrong but
> that CSS provides selectors that let authors easily improve them?
> (Why?)

Hmm?  Yes it does.  It's not in the initial block, but in the next one
down, because it has to explain what it means to have the "x" selector
there.  It similarly defines the margins for <h1>s based on nesting
depth in the appropriate section.

The rules are relatively simple, in that they only pay attention to
nested <h1>s specifically, but that seems fine.  An author can either
use just <h1-6> and no sectioning elements, or just <h1> and
sectioning elements.  Further control, allowing for nesting of <h2-6>
within sectioning elements, can be manually controlled by the author.

I still think we should provide a :heading(n) pseudoclass, but the
basic use-case is covered in the spec fine.

~TJ
Received on Thursday, 29 April 2010 17:37:04 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:22 UTC