盒子内部文字超出不换行

white-space CSS 属性是用来设置如何处理元素中的空白。

初始值 normal
适用元素 all elements
是否是继承属性 yes
适用媒体 visual
计算值 as specified
Animation type discrete
正规顺序 the unique non-ambiguous order defined by the formal grammar

语法

Formal syntax: normal | pre | nowrap | pre-wrap | pre-line
white-space: normal
white-space: nowrap
white-space: pre
white-space: pre-wrap
white-space: pre-line

white-space: inherit

normal
连续的空白符会被合并,换行符会被当作空白符来处理。填充line盒子时,必要的话会换行。
nowrap
和 normal 一样,连续的空白符会被合并。但文本内的换行无效。
pre
连续的空白符会被保留。在遇到换行符或者<br>元素时才会换行。 
pre-wrap
连续的空白符会被保留。在遇到换行符或者<br>元素,或者需要为了填充line盒子时才会换行。
pre-line
连续的空白符会被合并。在遇到换行符或者<br>元素,或者需要为了填充line盒子时会换行。

下面的表格总结了各种 white-space 值的行为:

 换行符空格和制表符文字转行
normal 合并 合并 转行
nowrap 合并 合并 不转行
pre 保留 保留 不转行
pre-wrap 保留 保留 转行
pre-line 保留 合并 转行
原文地址:https://www.cnblogs.com/dayin1/p/11234741.html