CSS for code tags

Recently I was looking at ways to improve the aesthetics of code I was putting up onto a site. I didn’t want to go down the route of a full on Javascript code highlighter but as I was looking at Syntax Highlighter I thought I must be able to replicate the look and feel (without the highlighting) just using CSS.

The basic premise is to repeat background stripes using em measures, to keep them inline with the text.

Here’s the result:

Leave a Reply

Your email address will not be published. Required fields are marked *