Skip to content

Instantly share code, notes, and snippets.

@mjangda
Created June 23, 2010 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjangda/450232 to your computer and use it in GitHub Desktop.
Save mjangda/450232 to your computer and use it in GitHub Desktop.
A cross-browser method to wrap really long strings using CSS
/** Disclaimer: this is not my code. I found this on pastebin and wanted to put it somewhere for easy reference. Thank you anonymous CSS god! **/
.selector {
/** Word Wrap **/
/** This will wrap really long strings, e.g. URLs, though without hyphenation **/
word-wrap: break-word; /* CSS 3 + IE */
white-space: -moz-pre-wrap; /* FF */
white-space: -o-pre-wrap; /* Opera */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment