" 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?

Is pre a new tag in html5?

青灯夜游
青灯夜游Original
2021-12-15 18:36:451968browse

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. 

Is pre a new tag in html5?

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!

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