Home > Web Front-end > HTML Tutorial > white-space: nowrap 与字符串(文本)换行_html/css_WEB-ITnose

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

WBOY
Release: 2016-06-24 11:34:45
Original
1191 people have browsed it

 

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

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

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

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

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template