Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solution for <pre></pre> to keep the format
11-05-2010, 12:37 AM
Post: #1
Solution for <pre></pre> to keep the format
You can use CSS to make the text wrap:

pre {
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+ */
}


If you don't want the text formatting changed at all, this CSS will use scrollbars to make all of the text viewable anyway:

pre {
width: 100%;
overflow: auto;
}
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:



Send your comments, Suggestions or Queries regarding this site at info@tutorials4u.net

Copyright © 2010 Tutorials4u.net All Rights Reserved