I been posting a few blog posting with code in the posting, i been trying to find some good software to make that task easy.... so far nothing the following steps looks some what promising
- Copy your Code into the following tool Convert Raw HTML to Escaped HTML
- Copy the Generated code and surround it with a div with a class of code and pre tags
- Add the following CSS to your page
<div class="code"> <pre> ...code ... ...code... </pre> </div>
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+ */
}
.code{
background-color: #FFFFFF;
width: 98%;
border: 1px ridge #999999;
text-align: left;
padding-left: 10px;
padding-top: 15px;
}
let me know what you think... or if you think there is a better way...
NOTE: Some of my old posts that have color code on a while background were done using a Mac OSX Software called Code (http://www.panic.com/coda/) which you can copy any text as XHTML.



0 Comments:
Post a Comment