<Pre> HTML Tag

In this article we have discuss about the pre tag in HTML.
  • 2201

We use the <pre> tag in the situation where you want to have the text to be shown exactly as it is typed. Spaces, tabs, and line breaks that exist in your actual code will be preserved with the <pre> tag. It is a preformatted text which means all the characters, text have the same format like width, linebreak as it was given.

HTML Code:

<html>

<head>

    <title></title>

</head>

<body><pre>

Use of Pre tag
Admin

    Register
    Log in
    Entries RSS
    Comments RSS
    WordPress.com

My Calendar
June 2012 M     T       W       T       F       S       S
« Jan            
        1       2       3
4       5       6       7       8       9       10
11      12      13      14      15      16      17
18      19      20      21      22      23      24
25      26      27      28      29      30       

 </pre>

 

</body>

</html>

 

Output:

Use of Pre tag
Admin

    Register
    Log in
    Entries RSS
    Comments RSS
    WordPress.com

My Calendar
June 2012 M     T       W       T       F       S       S
« Jan            
        1       2       3
4       5       6       7       8       9       10
11      12      13      14      15      16      17
18      19      20      21      22      23      24
25      26      27      28      29      30       
In this output we can see that in which format we have write the text in the HTML document exactly is coming in the output.
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 
© 2020 DotNetHeaven. All rights reserved.