Adding code inside a blogger post

To show Javascript or HTML inside a blogger post instead of executing them, you need to modify your template. Edit your template and find /b:skin

Copy the following code and put it just in front of ]]

pre
{
background:#F5F5DC;
border:1px solid #DC143C;
font-size:100%;
line-height:100%;
overflow:auto;
padding:9px;
color:#000000 }
}

picture of editing template and adding the pre tag

You can customize the colors with the CSS Color Chart.

Save your template.

Take the HTML code or Javascript that you want to display and prepare it for posting by using using one of these sites:
  1. http://www.elliotswan.com/postable/ 
  2. http://www.blogcrowds.com/resources/parse_html.php 
Take the output from this and place it between pre tags inside your post, for example:
picture showing actual blogger post containing the pre tags

Notes:
  • Don't worry if you can't see the box in preview mode or compose mode. When you publish it will be correct.
  • It is better to use blogger in draft (draft.blogger.com) instead of the original www.blogger.com when adding these tags.
blog comments powered by Disqus