A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/html/elements/pre below:

pre ยท WebPlatform Docs

pre Summary

The pre tag defines preformatted text. Text in a pre element is displayed in a fixed-width font and preserves both spaces and line breaks.

Overview Table
DOM Interface
HTMLPreElement

Examples of content might include:

This element is used with the code element, the samp element, or the kbd element, and so on, according to the kind of content inside a pre element.

Rendering in text/html

Unlike in XML mode, a text/html parser will strip the newline character if it appears after the opening <pre> tag, as an authoring convenience.

Accessibility

The author should consider accessibility, when use the pre element. This is because, when speech synthesizers, braille displays, and the like is used, there is a possibility that preformatted text is destroyed. For example, for cases like ASCII art, it is likely that an alternative presentation, such as a textual description, would be more universally accessible to the readers of the document.

Examples

This example uses the PRE element to format text so that it renders exactly as it is typed.

<pre>
This text is formatted
   exactly
      as
         it
      is
   typed.
</pre>

Example of pre-formatted computer code inside a <code> tag


<pre>
  <code>
  process.run();
  </code>
</pre>

Usage
 To cater for international users see: Managing text direction in form controls
Notes Remarks

Text within the PRE element is formatted. Spaces and carriage returns are preserved.

Related specifications
HTML 5.1
W3C Working Draft
HTML 5
W3C Recommendation
HTML 4.01
W3C Recommendation
See also Related pages Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4