Home  >  Article  >  Web Front-end  >  Let the

 tag text wrap automatically

Let the
 tag text wrap automatically

黄舟
黄舟Original
2017-07-08 11:55:542358browse


利用
这个标签可以将其包起来的文字排版、格式,原封不动的呈现出来。
也就是说你输入的东西被原封不动的输出,包括你输入的空格之类的,不用 和
等来表示空格或者回车了。

However, by default, the content in the 3b4ad93ea36080674ba857c5f6b82730 tag will not wrap automatically if it exceeds the range, which will cause trouble in display or printing.

The following provides CSS style code that complies with W3C standards and supports multiple browsers:


pre{
white-space:pre-wrap;
white-space:-moz-pre-wrap;
white-space:-pre-wrap;
white-space:-o-pre-wrap;
word-wrap:break-word;
}

It is best to add a p to the parent tag and set CSSAttribute:


word-wrap: break-word;white-space : normal

The above is the detailed content of Let the

 tag text wrap automatically. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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