perkee's blog

I heard you like science. tags
Mar 04
Permalink

Laying out Code in tumblr

(X)HTML’s <pre> is pretty cool for laying out codeblocks.  It allows you to put everything monospace, and interprets the whitespace literally. I thik it also is pretty forgiving if your code contains reserved HTML characters, but that might just be tumblr.  I actually just borrowed the CSS from my tumblr dashboard to make it look nice on my page.  If you want to do that, just go to your dashboard and click Customize.  Then click “Advanced” up top, and put the following into your “Add Custom CSS” box.
pre
{
margin:10px 0px 10px 0px;
padding:10px;
background-color:#e6e6e6;
font-family: "Bitstream Vera Sans Mono", Courier, monospace;
font:normal 11px;
overflow:auto;
}

code
{
background-color:#e6e6e6;
font-family: "Bitstream Vera Sans Mono", Courier, monospace;
font:normal 11px;
}

EDIT: I figured it would be worthwhile to format the <code> tag as well; it’s what allows for inline code à la twelve word prior

Comments (View)
blog comments powered by Disqus