Well, I really thought CSS so I went looking and found it http://dev.w3.org/csswg/css-lists-3/#counters-without-boxes
So with current perlmonks feature of a "code prefix" using <i></i> you get this chunk of html/css :)
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style type="text/css"> pre.code div.codeblock tt.codetext { counter-reset: codeLineCounter; } pre.code i::before { counter-increment: codeLineCounter; content: counter(codeLineCounter,decimal-leading-zero) ": "; } </style> </head> <body> <pre class="code"><div class='codeblock'><tt class='codetext'><i></i># +!/usr/bin/perl -- <i></i>use strict; <i></i>use warnings; <i></i>print "Hello <span class="line-breaker"> <font color="red">+</font></span> world!\n"; <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i> <i></i>1; </tt></div></pre>
In reply to Re^5: Change default style sheet: add line numbers (counter-increment: codeLineCounter;)
by Anonymous Monk
in thread Change default style sheet: add line numbers
by roboticus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |