English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
HTML <pre>-Tag definiert formatierten Text mit beibehaltenen Leerzeichen und Zeilenumbrüchen im HTML-Dokument. Dieses Tag wird auch als <pre>-Element bezeichnet.
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 ‹/›
IEFirefoxOperaChromeSafari
Most browsers currently support the <pre> Tag.
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: A common application of the <pre> Tag is to represent the source code of a computer.
in HTML 4.01 in, the 'width' attribute has been deprecated and cannot be used. HTML5 The 'width' attribute is not supported.
Attribute | Value | Description |
---|---|---|
width | number | HTML5 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) |
<pre> Tag supports global attributes, see the complete attribute table HTML Global Attributes.
<pre> Tag supports all HTML Event Attributes.