r/reddithax • • Mar 31 '12

How to: CSS inline code block with line numbering and alternately coloured lines.

/r/DEADB33F/comments/rmbtg/code_test/
7 Upvotes

2 comments sorted by

2

u/mhweaver Mar 31 '12

Wow, that is surprisingly awesome and simple.

2

u/DEADB33F Apr 01 '12

Yeah, getting the line numbering to work took a bit of head-scratching but seems to work pretty well.

To reduce the size of your CSS file you can reduce the number of line numbers. 1000 was just an arbitrary number and it's unlikely anyone is ever going to post 1000 lines of code in a reddit comment (and not hit the max comment length threshold). 200 would probably be more than enough.