Code Tags in Blogs and Lack of Support Thereof
April 22, 2008 – 10:30 pmMost WordPress themes have little (if any) respect for code and pre tags. I stumbled upon a blog some time ago whose support of said tags I quite liked. I dug up the CSS code and mailed it to myself.
Upon recent cleaning of my inbox I stumbled upon it again, and actually applied it to current theme. The designer of the current theme is someone named Bob who hates white space!
Anyway, for posterity, and so I can look for it later, here’s the code. (It may well be able to be stream lined - I’m certainly neophyte enough in CSS still to not know any better.)
pre, code {
background:#FFFFFF url(/wp-content/themes/preback.jpg) no-repeat scroll left top;
border: 1px solid #99CC66;
color: #000000;
display: block;
font-family: 'Courier New', Courier, Fixed, monospace;
font-size: 110%;
font-size-adjust: none;
font-stretch: normal;
font-style: normal;
font-variant: normal;
font-weight: normal;
line-height: 17px;
margin: 1em 0pt;
overflow: auto;
padding: 0pt 20px 0pt 30px;
text-align: left;
}
One Response to “Code Tags in Blogs and Lack of Support Thereof”
Hmm, this code is causing problems in Safari and FireFox 3.0b4. In Safari, it’s breaking on a blank line. In FireFox it’s ending at a blank line.
The pre tag works okay, though.
By bshirley on Apr 28, 2008