Admins eHow SysAdmin Tips & Tricks

May 31, 2009

Wrap text in pre tag

Filed under: CSS,HTML — Tags: , , , , — admin @ 5:21 pm

use the following CSS code to wrap the lines in a pre html tag :

pre {
white-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */
white-space: -pre-wrap; /* Opera 4 - 6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */
word-wrap: break-word; /* IE 5.5+ */
}

Powered by WordPress