好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

white-space:nowrap与字符串(文本)换行_html/css_WEB-ITnose

在需要对字符串进行元素内换行时,我们通常要对该元素设置相关属性约束以及宽度。

  例如: style="word-wrap:break-word; word-break: break-all; width: 5px;"

  也就是在文本内容长度超过5个px时,进行换行。

   但是, 我们这时要注意其父元素上是否设置了 white-space: nowrap ,由于 white-space: nowrap 具有可继承性,这就使得内嵌元素设置的换行样式无效。

查看更多关于white-space:nowrap与字符串(文本)换行_html/css_WEB-ITnose的详细内容...

  阅读:41次