CSS Pre tag wrapping

Rather than having scroll bars appear on your pre tag section you can get it to wrap with the following css codes:

Show Plain Text
CSS code
  1. pre {
  2.  white-space: pre-wrap;       /* css-3 */
  3.  white-space: -moz-pre-wrap !important;  /* Mozilla, since 1999 */
  4.  white-space: -pre-wrap;      /* Opera 4-6 */
  5.  white-space: -o-pre-wrap;    /* Opera 7 */
  6.  word-wrap: break-word;       /* Internet Explorer 5.5+ */
  7. }

For those who are after W3C CSS validation it would be better to use a div section to achieve the same result.

Reference Site:

Filed under: Design  Tags: Css

1 Responses to “CSS Pre tag wrapping”

thank you for information

Sorry, comments have been closed for this post.