Html pre tag


Prev Tutorial Next Tutorial

pre tag

<pre> tag are show text on web page as it is written on html page including break line, number of space. In Html if you enter more than one space between two text it not show on browser only single space display, for show all given space you need to use <pre> tag.

With <pre> tag and without <pre> tag

If we give line brake or number of space between text it ignored by browser only show single space

Example

<html>
<head>
 <p>
 This is html example
           This is pre tag
 </p>
</body>
</html>

Result

This is html example This is pre tag

In above example spaces are not display on web page and also not display break line.

<pre> tag are show text on web page as it is written on page including break line, number of space.

Example

<html>
<head>
 <pre>
 This is html example

           This is pre tag
 </pre>
</body>
</html>

Result

 This is html example
           This is pre tag

In above example spaces and break line are display on web page as it is written in html page.

Browser supported

Element
<pre>YesYesYesYesYes

Prev Tutorial Next Tutorial

Advertisements




Facebook Likes

Advertisements