I think you're complicating things a lot by trying to force a source code prettyprinter into rendering just a blob of monospace text, if you study the source of the page at gitgub you'll see that it's just some css
pre {
background-color: #F8F8F8;
border: 1px solid #DDDDDD;
border-radius: 3px 3px 3px 3px;
font-size: 13px;
line-height: 19px;
overflow: auto;
padding: 6px 10px;
font-family: Consolas,"Liberation Mono",Courier,monospace;
}
I made you a Fiddle that shows all the components.
For this kind of studies the Firebug plugin for Firefox is an absolute must, it allows you to grab every element on a page, look at the different css rules that modify its appearance, play around with the rules to see the effect, and thousands of things more. Even if you're only slightly interested in web development, you really should have Firebug and know how to use it.