Yahoo India Web Search

Search results

  1. Learn how to use the HTML pre tag to display preformatted text with fixed-width font and preserved spaces and line breaks. See examples, browser support, global and event attributes, and default CSS settings.

  2. Jun 26, 2024 · Learn how to use the HTML tag to define preformatted text that preserves spaces, line breaks, tabs, and other formatting characters. See examples, syntax, and supported browsers for this tag.

  3. People also ask

    • Overview
    • Try it
    • Attributes
    • Accessibility concerns
    • Examples
    • Browser compatibility
    • See also

    The HTML element represents preformatted text which is to be presented exactly as written in the HTML file. The text is typically rendered using a non-proportional, or monospaced, font. Whitespace inside this element is displayed as written.

    By default, is a block-level element, i.e. its default display value is block.

    If you have to display reserved characters such as <, >, &, and " within the tag, the characters must be escaped using their respective HTML entity.

    This element only includes the global attributes.

    cols Non-standard Deprecated

    Contains the preferred count of characters that a line should have. It was a non-standard synonym of width. To achieve such an effect, use CSS width instead.

    width Deprecated Non-standard

    Contains the preferred count of characters that a line should have. Though technically still implemented, this attribute has no visual effect; to achieve such an effect, use CSS width instead.

    wrap Non-standard Deprecated

    It is important to provide an alternate description for any images or diagrams created using preformatted text. The alternate description should clearly and concisely describe the image or diagram's content.

    People experiencing low vision conditions and browsing with the aid of assistive technology such as a screen reader may not understand what the preformatted text characters are representing when they are read out in sequence.

    Basic example
    Escaping reserved characters

    BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

    •CSS: white-space, word-break

    •HTML Entity

  4. Learn how to use the HTML pre tag to create preformatted text and code blocks in your web pages. The pre tag preserves white spaces and monospaced font by default.

  5. The HTML pre tag is used to insert preformatted text into an HTML document, preserving spaces and line breaks. Learn how to use the pre tag with examples, attributes, and CSS properties.

  6. html.com › tags › pre<pre> HTML Tag

    Learn how to use the HTML tag to preserve line breaks and spaces in text, such as code blocks or ASCII art. See examples, browser support and usage tips for this element.

  7. PRE: Preformatted text. Preformatted elements in HTML are displayed with text in a fixed width font, and so are suitable for text which has been formatted for a teletype by some existing formatting system. The optional attribute is: WIDTH. This attribute gives the maximum number of characters which will occur on a line.

  1. People also search for