Saturday, May 16, 2009

Code Snippets in Blogger

I just want to reactivate this blog after more than one year inactivity :-D ... As the first step I have to set the environment here such that I could easily post some sorts of source code. I found these two interesting hints at bguide and urenjoy. I completely followed these hints, and let's see whether it works ... :-D

The snippet below is using the CSS div-tag :


/*
Custom CSS class to display code snippets.
http://bguide.blogspot.com/
2008 Feb 03
*/
.mycode
{
border:1px dashed #aaaaaa;
background:#eeeeee;
white-space:pre;
font-family:monospace;
font-size:9pt;
line-height: 10pt;
height:auto;
width:auto;
padding:5px;
margin-left:10px;
overflow:auto;
}


This is the snippet displayed using Alex's Syntaxhighlighter:


/*
Custom CSS class to display code snippets.
http://bguide.blogspot.com/
2008 Feb 03
*/
.mycode
{
border:1px dashed #aaaaaa;
background:#eeeeee;
white-space:pre;
font-family:monospace;
font-size:9pt;
line-height: 10pt;
height:auto;
width:auto;
padding:5px;
margin-left:10px;
overflow:auto;
}