W3C home > Mailing lists > Public > www-html@w3.org > May 2003

[XHTML2WD5] Ilegal CSS Example

From: (wrong string) äper <christoph.paeper@tu-clausthal.de>
Date: Fri, 9 May 2003 00:26:48 +0200
Message-ID: <037e01c315b0$eb167210$3ef4ae8b@heim4.tuclausthal.de>
To: <www-html@w3.org>

9.7. The l element

| <p class="program">
| <l>program p(input, output);</l>
| <l>begin</l>
| <l>   writeln("Hello world");</l>
| <l>end.</l>
| </p>

|  .program { counter-reset: linenumber }
|  l:before {
|    position: relative;
|    left: -1em;
|    counter-increment: linenumber;
|    content: counter(linenumber);
|  }

At least in CSS 2.0 generated content can't be positioned. In CSS3 it would
be "l::before". Also "counter(linenumber, decimal-leading-zero);" might be
more appropriate. With the introduction of 'blockcode' it should be used
here:

 <blockcode>
 <l>begin</l>
 <l>   writeln("Hello world");</l>
 <l>end</l>
 </blockcode>

 blockcode {counter-reset: linenumber;}
 l::before {
   counter-increment: linenumber;
   content: counter(linenumber, decimal-leading-zero);
 }

Christoph Päper
Received on Thursday, 8 May 2003 18:26:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:55 GMT