I struggled trying to get SyntaxHighlighter to work for a long time (Chrome and Blogger produced horrible scrolling divs).
I finally settled on Google Code Prettify. It seems more straight forward than SyntaxHighlighter, but works great.
Everything you need to know can be found in the README
Load the script in the <head>
section of the blogger template:
<script language='javascript' type='text/javascript'
src='http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js' />
<script language='javascript' type='text/javascript'
src='http://google-code-prettify.googlecode.com/svn/trunk/src/lang-css.js'/>
<script type='text/javascript'>
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
addLoadEvent(prettyPrint);
</script>
The format using <pre class="prettyprint">
or <pre class="prettyprint lang-yaml">'
or inline with <code class="prettyprint">
.
Oh, it supports multiple languages and themes.