Zachary Loeber

The personal website of Zachary Loeber.

CSS: Pretty Code Snippet Formatting

2011-08-05 1 min read Other Web Publishing Zachary Loeber

I forgot where I dredged this up from but here is how I do my code/script posts. I modified the default theme css and add the following for pre-formatted text:

pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
background: #000000;
color: #21FF2C;
}
comments powered by Disqus