ultraweaver - beyond the basics
Follow on twitter.

CSS Code Block Formatting. Keeps Your Design Intact.

March 14th, 2010

I am not sure who came up with this little nugget. I have seen it around a few times, but who ever you are, I love you…

If you ever have the need to share blocks via an HTML page (like this blog)  that others will copy and paste from, use the CSS style below. Your web visitors will appreciate it. Plus, it will also keep your design from exploding due to long lines of code.

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+ */

}
Going Beyond the Basics With...
HTML CSS PHP MySQL Dreamweaver Fireworks
Categories
  • Adobe Fireworks (2)
  • CSS (2)
  • Games (1)
  • HTML (1)
  • iPhone Apps (1)
  • Misc. (5)
  • Objective-C (2)
  • PHP (1)
  • Tag Cloud
    , , ,
    Nology Interactive