It is easy to use CSS to style code snippets, as shown in Figure 1.

Figure 1: Sample output of CSS style for code snippets
Step 1: Append this code inside a style sheet.
pre{
font-size:12px;
background:#fff;
border:1px solid #000;
line-height:20px;
width:600px;
overflow:auto;
overflow-y:hidden;
margin:0;
padding:0;
}
pre code{
font-family:Monaco,Courier;
display:block;
margin:0 0 0 40px;
padding:18px 0;
}
Step 2: Put the code snippets inside <pre> and <code> tags.
<pre><code>def f():
txt = "Some sample code"
return txt
</code></pre>
If you are new here, you might want to subscribe to the RSS feed or newsletter.
Creates the exact copy of your hard disk and allows you to instantly restore the entire machine.
New Acronis True Image Home 2010 is the most reliable and easy in use backup solution. Now with online backup option!
15% Discount Code: FMAATIH2010
New Acronis True Image Home 2010 is the most reliable and easy in use backup solution. Now with online backup option!
15% Discount Code: FMAATIH2010







