css 强制代码包裹

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css 强制代码包裹相关的知识,希望对你有一定的参考价值。

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

/* 
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.
*/

以上是关于css 强制代码包裹的主要内容,如果未能解决你的问题,请参考以下文章