Pre Tag

The HTML tag is used for indicating preformatted text. The code tag surrounds the code being marked up.
Browsers normally render pre text in a fixed-pitched font, with whitespace in tact, and without word
wrap.

EXAMPLE

<!DOCTYPE html>
<html>
<head>
<title>HTML pre Tag</title>
</head>
<body>
<pre>
This text is
in a fixed-pitch
font, and it preserves
both spaces and line breaks
</pre>
</body>
</html>

OUTPUT

This text is
in a fixed-pitch
font, and it preserves
both spaces and line breaks

This will produce following result:
This text is in a fixed-pitch font, and it preserves both spaces and line breaks.

Browser Support

ChromeFirefoxIEOperaSafariAndroid
YesYesYesYesYesYes

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close Menu