mozilla
Your Search Results

    <pre> Redirect 1

    There was a scripting error on this page. While it is being addressed by site editors, you can view partial content below.

    Summary

    The HTML <pre> Element (or HTML Preformatted Text) represents preformatted text. Text within this element is typically displayed in a non-proportional font exactly as it is laid out in the file. Whitespaces inside this element are displayed as typed.

    Attributes

    This element only includes the global attributes.

    cols
    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 styling instead.
    width
    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 styling instead.
    wrap
    Is a hint indicating how the overflow must happen. In modern browser this hing is ignored and no visual effect results in its present; to achieve such an effect, use CSS styling instead.

    Examples

    <!-- Some example CSS code -->
    <pre>
    body {
      color:red;
    }
    </pre> 
    

    Result

    body {
      color:red;
    }
    

    Specifications

    Specification Status Comment
    WHATWG HTML Living Standard Living Standard No significant change from WHATWG HTML Living Standard
    HTML5 Candidate Recommendation No significant change from HTML 4.01 Specification
    HTML 4.01 Specification Recommendation Deprecated the cols attribute

    Browser compatibility

    Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
    Basic support 1.0 1.0 (1.7 or earlier) (Yes) (Yes) (Yes)
    width (Yes)
    No layout effect
    1.0 (1.7 or earlier)
    Layout effect removed in 29.0 (29.0)
    (Yes)
    No layout effect
    (Yes)
    No layout effect
    (Yes)
    No layout effect
    cols Not supported 1.0 (1.7 or earlier)
    Removed in 29.0 (29.0)
    Not supported Not supported Not supported
    wrap ? 1.0 (1.7 or earlier) ? ? ?
    Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
    Basic support (Yes) 1.0 (1.0) (Yes) (Yes) (Yes)
    width ? 1.0 (1.0)
    Layout effect removed in 29.0 (29.0)
    ? ? ?
    cols Not supported 1.0 (1.0) Not supported Not supported Not supported
    wrap ? 1.0 (1.0) ? ? ?

    See also

    {{ HTMLRef }}

    Document Tags and Contributors

    Contributors to this page: Sheppy
    Last updated by: Sheppy,