Distinguish between the P and BR tag.

Q8. Distinguish between the <P> tag and the <BR> tag with the help of an example.

Ans. The main difference between the <BR> and <P> tags is that the <BR> tag is used to insert a line break on the Web page; whereas, the <P> tag is used to mark a block of text as a paragraph or separate your text into different paragraphs. The <P> tag not only allows you to represent the text in the paragraph format but also enables you to format the paragraph text.

 

Example of using the <P> tag:

<HTML>

<HEAD>

<TITLE>

WELCOME TO HTML

</TITLE>

</HEAD>

<BODY>

<P> HTML stands for Hyper Text markup language that is commonly used to create Web pages. </P> <P> A markup Language describes the structure of a Web page, specifying how text or graphics are displayed on the Web page.</P>

<P> An HTML tag is a command to instruct the Web browser how to display the content in a Web page.</P>

</BODY>

<HTML>

 

Example of using the <BR> tag:

<HTML>

<HEAD>

<TITLE>

WELCOME TO HTML

</TITLE>

</HEAD>

<BODY>

HTML stands for Hyper Text markup language that is commonly used to create Web pages. <BR>  A markup Language describes the structure of a Web page, specifying how text or graphics are displayed on the Web page. <BR> An HTML tag is a command to instruct the Web browser how to display the content in a Web page

</BODY>

<HTML>

PRE tag.

Q2. Explain the use of <PRE> tag with the help of an example.

Ans. The <PRE> tag in HTML defines the preformatted text. This implies that this tag helps you not display text in the Web browser in a fixed-width font but also display the text in the same way as you have typed in it the code. The <PRE> tag displays the text in the Web browser with all blank lines and tabs.

The <PRE> tag is useful for displaying code in a Web page. The default text font that the PRE tag uses is the Courier font. You should use the <PRE> tag to maintain a text format, which includes line breaks and tabs.

Example of using the <PRE> tag: Read More …