Skip to content

Instantly share code, notes, and snippets.

@trumball
Created May 24, 2013 19:38
Show Gist options
  • Save trumball/5645988 to your computer and use it in GitHub Desktop.
Save trumball/5645988 to your computer and use it in GitHub Desktop.
Force Code Wraps The typical pre tags are used in layouts to display large chunks of code. This is preformatted text like you would find inside Notepad or Textedit, except you’ll often notice long lines produce horizontal scrollbars. This block of CSS will force all pre tags to wrap code instead of breaking outside the container.
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+ */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment