PRE / CODE CSS Style

I don’t know if anyone has ever found their PRE or CODE not wrapping, but I have and this little gem of code is the code I use to clean it up.  Here’s a link to my Snipplr version of the code.

pre {
white-space: pre-wrap; /* css-3 should we be so lucky... */
white-space: -moz-pre-wrap; /* 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+ */
_white-space: pre; /* IE only hack to re-specify in addition to word-wrap */
}

This entry was posted in CSS. Bookmark the permalink.

About Brandon Buttars

I am a web designer, search engine optimizer, blogger, writer, graphic designer, wannabe programmer, blah blah internet guru. I do just about everything required in building websites and applications. I'm also a father to 2 boys, soon to be 3, and married happily to my wonderful wife. I'm trying to balance my personal life and my entrepreneurial tendencies.

One Response to PRE / CODE CSS Style

  1. limpieza says:

    good article, i will add my feeds.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>