" tag element usually retains spaces and newlines; the "width" attribute of the pre tag is obsolete in HTML4.01 and no longer in HTML5 support."/> " tag element usually retains spaces and newlines; the "width" attribute of the pre tag is obsolete in HTML4.01 and no longer in HTML5 support.">
Home > Article > Web Front-end > Is pre a new tag in html5?
pre is not a new tag in html5. The pre tag is used to define pre-formatted text. The text enclosed in the "
" tag element usually retains spaces and newlines; the "width" attribute of the pre tag is obsolete in HTML4.01 and is not included in HTML5. Support again.
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
pre is not a new tag in html5.
The
tag defines preformatted text. Text enclosed in <pre class="brush:php;toolbar:false"> tag elements usually preserves spaces and newlines. The text will also be rendered as a fixed-width font. <p></p><pre class="brush:php;toolbar:false"> tags support an attribute "width" that defines the maximum number of characters per line (usually 40, 80, or 132). <p>But<span style="color: rgb(255, 0, 0);">In HTML 4.01, the "width" attribute is obsolete and cannot be used. HTML5 does not support the "width" attribute. </span></p><p>Example:<br></p><pre class="brush:html;toolbar:false"><!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <pre class="brush:php;toolbar:false"> 此例演示如何使用 pre 标签 对空行和 空格 进行控制
此例演示如何使用 pre 标签 对空行和 空格 进行控制
The above is the detailed content of Is pre a new tag in html5?. For more information, please follow other related articles on the PHP Chinese website!