Home > Uncategorized > Using Syntax Highlighter for code highlighting

Using Syntax Highlighter for code highlighting

December 19th, 2012

If you write tutorials or if you need to display some code snippets, a highlighted code makes life much easy for the readers. We were recently looking at some solutions that exist on internet and came across a number of solution. One of the most promising one was free Syntax highlighter made available by Alex Gorbachev at his site. We had an opportunity to install and test this and we found it very helpful. But you need to take care of few thing to be able to make it useful. Here are some tips (other than those found scattered on internet).

1. To remove the question mark that appears on the top right hand side you need to include the following option.
toolbar: false

This will make the question mark and the link go away.

2. If you plan on using html code to be displayed use the script method in place of the pre method.

3. To make vertical scroll go away and instead introduce a horizontal scroll, add the following lines in the corresponding stylesheet.

Basically you need to add the

overflow-y: hidden !important;

to remove the vertical scroll and add

overflow-x: auto !important;

to introduce horizontal scroll ( automatic).

echo "Hello World";



  1. No comments yet.
  1. No trackbacks yet.