Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a (free of charge) predefined CSS library for C# code formatting available? I want to display my C# <code> blocks in a web page similar to the way it is displayed in visual studio or even Stackoverflow.

<code class="lang-csharp">
//pretty formatted code
share|improve this question
up vote 5 down vote accepted

I use http://alexgorbatchev.com/SyntaxHighlighter/ on my website. It is a JavaScript library that adds syntax highlighting to code blocks on your page. It supports C# as well as most other programming languages.

share|improve this answer
+1 - that's an awesome library – shea Mar 28 '13 at 10:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.