Use of the BODY tag in HTML code.

Q15. What is the use of the <BODY> tag in HTML code? Write any two attributes used with this tag.

Ans. BODY tag includes all the tags, attributes, and information that is to be displayed on the Web page. Whatever we see on a Web page is enclosed within the <BODY> and </BODY> tags.

 

Bgcolor, background are attributes of BODY tag.

Method of viewing the source code of the current page in Web Page.

Q13. What is the method of viewing the source code of the current page in Web Page?

Ans. To view the HTML source code behind a web page, follow these simple steps:

  1. Go online and open a web browser, such as Mozilla Firefox or Internet Explorer.
  2. Go to any website by typing the URL of any web page whose HTML source code you’d like to see.
  3. Look at the HTML source of the page:
    • In Firefox, choose View→Page Source from the menu bar.
    • In Internet Explorer, choose View→Source.

You’ll see a new window with the HTML code for the current page you are viewing. If you glance through the code, you’ll see the text content of the page and all the <a> tags for each link. You can select and copy the whole page or any portion of it.

Purpose of using the tags H1….H6.

Q12. What is the purpose of using the tags <H1>….<H6>?

Ans. HTML provides six levels of heading, which are specified by the following tags: <H1>, <H2>, <H3>, <H4>, <H5>, <H6>. Any text that is placed within the preceding tags appears in bold and the size of the text depends on the heading level, with <H1> being the largest heading and <H6> being the smallest. They allow you to present the information in the document in an organized way.

Which tag do we use to change the size and style (face) of the text of an HTML file.

Q11. Which tag do we use to change the size and style (face) of the text of an HTML file viewed on a Web browser?

Ans. The <FONT> tag is used to change the size and style (face) of the text of an HTML file viewed on a Web browser.

Why do we insert comments in an HTML document even though they are not displayed on a Web page.

Q9. Why do we insert comments in an HTML document even though they are not displayed on a Web page?

Ans. Comments are meant for the developers and programmers to understand code. They are not displayed in the Web browser.

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>