HTML pre tag

The tag represents preformatted text in an HTML document. The pre tag preserver both spaces and line breaks in the specified text.

HTML pre tag

The <pre> tag represents preformatted text in an HTML document. The pre tag preserver both spaces and line breaks.

Syntax

<pre>Some text here</pre>

Attributes

AttributeValueDescription
widthnumberNot supported in HTML 5

This tag supports all HTML global attributes and HTML event attributes.

Example

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <pre>This is an example for
pre fromated text. This tag preserves
both
spaces      and
line breakes.
    </pre>
</body>
</html>

Output

This is an example for
pre fromated text. This tag preserves
both
spaces      and
line breakes.

Share Tweet Send
Loading...
You've successfully subscribed to Geekinsta
Great! Next, complete checkout for full access to Geekinsta
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.