Preformatted HTML

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

PREFORMATTED TAG

Usually the browser ignores all white spaces and extra returns and automatically breaks
lines according to size of the browser. However there is a way to make browser display
the text exactly as you type in your HTML document. The preformatted text lets you
maintain the original spaces and line breaks that you have inserted in your text. Let us
demonstrate the <pre> tags with code below :

<html>
<head>
<title>Preformatted tag</title>
</head>
<body>
<pre>
Hello there !...
My name is sourabh bhandari... I am studying in Guru Nanak Dev University
situated
in holy city of amritsar.
</pre>
</body>
</html>

The following table describes the attributes that is supported by <pre> tag :

Attribute class, dir, id, lang, onClick, onDblClick,


onKeyDown, onKeyPress, onKeyUp, onMouseDown,
onMouseMove, onMouseOut, onMouseOver,
onMouseUp, style, title, width.

© Copyright Sourabh Bhandari http://sourabhandari.in

You might also like