Rory's Blog
Home
Blog
Projects
Facebook
Google+
Github
RSS

Meta: Styling Code

07/13/14

So, in this post (circular dependency warning!) I posted some vim script code.

Typically, when I see code posted on the Interwebz I see it formated differently, and for good reason. Code needs to stand out, needs to look like code. Bare minimum, it needs:

And so I quickly threw together some css for just that purpose.

#content .code {
    background-color: #D8D8D8;
    width: 400px;
    margin-left: 25px;
    font-size: 10pt;
    font-family: monospace;
}

Now, I just wrap code in a div of class "code" and it'll style how I want it. Also, I can make the styling better later. Right now, it's not that pretty.

Note: that code above is also apart of class "css". I plan to also assign a class of whatever code type code text is. Maybe, eventually, I'll style the code-type as well.

A goal to add to the pile, I guess.