Home > Web Front-end > HTML Tutorial > Let the
 tag text wrap automatically                

Let the
 tag text wrap automatically

黄舟
Release: 2017-07-08 11:55:54
Original
2534 people have browsed it


利用<pre class="brush:php;toolbar:false">
这个标签可以将其包起来的文字排版、格式,原封不动的呈现出来。
Copy after login
也就是说你输入的东西被原封不动的输出,包括你输入的空格之类的,不用 和<BR>等来表示空格或者回车了。
Copy after login

However, by default, the content in the

 tag will not wrap automatically if it exceeds the range, which will cause trouble in display or printing. </p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; color:rgb(69,69,69); font-family:tahoma,helvetica,arial; font-size:14px; line-height:21px">The following provides CSS style code that complies with W3C standards and supports multiple browsers: </p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; color:rgb(69,69,69); font-family:tahoma,helvetica,arial; font-size:14px; line-height:21px"><br/></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'>pre{
white-space:pre-wrap;
white-space:-moz-pre-wrap;
white-space:-pre-wrap;
white-space:-o-pre-wrap;
word-wrap:break-word;
}
Copy after login

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


word-wrap: break-word;white-space : normal
Copy after login

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!

Related labels:
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template