W3C home > Mailing lists > Public > www-style@w3.org > June 2014

Re: [css-gcpm] Idea for example 18

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 13 Jun 2014 09:09:01 -0700
Message-ID: <CAAWBYDCKz_H2Ren_5QXvuWokDkNtbFJ54f-kUAVYBRTEaZSdUg@mail.gmail.com>
To: Håkon Wium Lie <howcome@opera.com>
Cc: Dave Cramer <dauwhe@gmail.com>, Jirka Kosek <jirka@kosek.cz>, W3C Style <www-style@w3.org>
On Fri, Jun 13, 2014 at 8:31 AM, Håkon Wium Lie <howcome@opera.com> wrote:
> Also sprach Tab Atkins Jr.:
>
>  > > target-counters() could be used to create a reference to the numbering
>  > > inside a multilevel list, which can use counters(). I'll keep trying to
>  > > think of a semi-realistic example for that.
>  >
>  > If you're using nested sections, you can set the counters on the
>  > sections themselves, rather than the headings.  That way you get the
>  > nesting structure automatically, without having to do the six
>  > separately-managed counters.
>
> Yes, or in combination with <header>:
>
>   header:first-of-type { counter-reset: s }
>   header { counter-increment: s }
>   header:before { content: "Section " counters(s,".") ": " }
>
>   <section>
>     <header>Europe</header>
>       <section>
>         <header>San Marino</header>
>         <header>Monaco</header>
>       </section>
>     </header>
>   </section>

Oh yeah, you're right, as long as you're using <section> nesting, then
the way scopes work will cover this fine on headers.

~TJ
Received on Friday, 13 June 2014 16:09:49 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:22 UTC