Skip to content

HTML CSS Trick for wrapping long lines with PRE tag

Note

Useful for displaying code snippets for example

 

  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. }