English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

HTML-Tagverzeichnis

HTML: <pre> Tag

HTML <pre>-Tag definiert formatierten Text mit beibehaltenen Leerzeichen und Zeilenumbrüchen im HTML-Dokument. Dieses Tag wird auch als <pre>-Element bezeichnet.

Online Beispiel

Formatiert Text:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>Grund教程(oldtoolbag.com)</title> 
</head>
<body>
<pre>Text wird hier eingefügt         Zeilenumbriken und Leerzeichen beibehalten
und Zeilenumbriken beibehalten</pre>
</body>
</html>
Testen Sie es heraus ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

Most browsers currently support the <pre> Tag.

Tag definition and usage instructions

The <pre> Tag can define preformatted text.

Spaces and line breaks within the <pre> Tag will be preserved and displayed exactly the same as the spaces within the <pre> Tag.

Text enclosed in <pre> Tag elements usually preserves spaces and line breaks. The text will also be displayed in a monospaced font.

Hint and Note

Hint: A common application of the <pre> Tag is to represent the source code of a computer.

in HTML 4.01 with HTML5differences

in HTML 4.01 in, the 'width' attribute has been deprecated and cannot be used. HTML5 The 'width' attribute is not supported.

Attribute

AttributeValueDescription
widthnumberHTML5 This attribute is not supported. HTML 4.01 This attribute has been deprecated. Define the maximum number of characters per line (usually 40,80 or 132)

global attributes

<pre> Tag supports global attributes, see the complete attribute table HTML Global Attributes.

event attributes

<pre> Tag supports all HTML Event Attributes.