W3C home > Mailing lists > Public > www-style@w3.org > September 2006

Re: [CSS21] Possible counters() limitation?

From: Werner Donné <werner.donne@re.be>
Date: Mon, 11 Sep 2006 10:58:28 +0200
Message-ID: <45052534.6000501@re.be>
To: www-style@w3.org

I think the following example is the solution:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title></title>
    <style type="text/css">
div:before { content: counters(item, '.'); counter-increment: item; }
div > *:first-child { counter-reset: item; }
div { margin-left: 20pt; }
    </style>
  </head>
  <body>
    <div>
      Level 1
      <div>Level 1.1</div>
      <div>
        Level 1.2
        <div>Level 1.2.1</div>
        <div>Level 1.2.2</div>
      </div>
      <div>
        Level 1.3
        <div>Level 1.3.1</div>
        <div>
          Level 1.3.2
          <div>Level 1.3.2.1</div>
        </div>
      </div>
    </div>
  </body>
</html>

Werner.
-- 
Werner Donné  --  Re
Engelbeekstraat 8
B-3300 Tienen
tel: (+32) 486 425803	e-mail: werner.donne@re.be
Received on Monday, 11 September 2006 08:58:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:46 GMT