techsolv

where every visitor is statistically significant

You are here: Home » Articles » General » CSS pre tag quirks
Monday, 06 Feb 2012

CSS pre tag quirks

The "pre" tag can be pretty quirky. Essentially, I have noticed that the "box's" right side is not managed as expected - it acts as though it's essentially infinite.  I added the following tags shown in lines 4-9 and got the behavior that I was expecting.

pre {
background: #f7f7f7;
border: 1px solid #f0f0f0;
white-space: pre-wrap;       /* css-3 */  
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+ */  
}
Last modified on Saturday, 07 August 2010 10:16
John Houghton

John Houghton

John is IT professional with the unusual ability to actually conjugate verbs.  Spelling?  uh, not so much so.  Sense of humor?  Sorta.

Website: www.techsolv.cc