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 }
}

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:
Take the output from this and place it between pre tags inside your post, for example:

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.