php中英文输出自动换行

WBOY
Release: 2016-05-19 12:15:06
Original
1843 people have browsed it

 在页面输出汉字时,如果区域宽度不够了,会自动换行,然而,英文字母不可以,也就是说你输出类似"aaaaaaaaaaaa"的一串字符,页面认为这是一个单词,无法断开,如果在

中输出,而这个区域宽度只有3个字符,那么,页面将发生错位。如果换成"aaa aaa aaa aaa" 当然可以了,因为页面把他们看做是是四个单词,也就能换行了。

如果想强行换行在只需在CSS设计中加上 word-wrap:break-word;/*强行换行*/即可

#test{

......;

......;

word-wrap:break-word;/*强行换行*/

}

Related labels:
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