English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Die "pre width"-Eigenschaft spezifiziert die maximale Anzahl von Zeichen pro Zeile. Nur Firefox unterstützt Version1.0 to29.0's width attribute.
Formatierter Text, Breite40 Zeichen:
!DOCTYPE html <html> <head> <title>HTML: <width> name Eigenschaft - Grundlagen-Tutorial-Website(oldtoolbag.com)</title> </head> <body> <p>Normale "pre":</p> <pre> Text in einem "pre"-Element wird in einer festen-Breite Schriftart, und es bewahrt sowohl Leerraum als auch Zeilenbrüche </pre> <p>Definition einer spezifischen Breite für "pre":</p> <pre width="40"> Text in einem "pre"-Element wird in einer festen-Breite Schriftart, und es bewahrt sowohl Leerraum als auch Zeilenbrüche </pre> </body> </html>Testen Sie es heraus ‹/›
IEFirefoxOperaChromeSafari
Firefox Supported Version1.0 to29.0's width attribute.
HTML5 The <pre> width attribute is not supported. Please use CSS instead.
In HTML 4.01 In the <pre> tag, the width attribute is deprecated.
The width attribute specifies the maximum number of characters per line.
In HTML 4.01 In the <pre> tag, the width attribute is deprecated. Please use CSS instead.
CSS Syntax:<div style="width:200px;overflow:auto"><pre>Some text</pre></div>
CSS Example: Preformatted text with fixed width
In our CSS tutorial, you can find more about width attribute details.
Tip:If the text width exceeds the width of the surrounding element, the overflow attribute adds a scrollbar.
<pre width="number">
Value | Description |
---|---|
number | Set the width in number of characters. |