Sunday, November 21, 2010

CSS to show code snippet

You can show your code snippets in HTML pages using PRE or CODE tags. Following is a very simple CSS code to display the code in a code snippet.

pre{
border: 1px dashed #B11718;
background: white;
color: black;
font-family: Courier;
font-size: 11pt;
padding: 10px 30px;
}

If you want to add more styles, then use the widget written by Alex Gorbatchev.The details of how to use the library is given at http://www.bloggersentral.com/2009/04/how-to-show-code-in-blog-post.html

No comments:

Post a Comment