Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

What does <BODY> tag in HTML contain? Write any two attributes used with this tag.

Answer»

The <BODY> tag encloses the main part of the document. It contains all the contents of a document. Various markup elements are allowed within the body to indicate headings, paragraphs, lists, hypertext links, images and so on. The <BODY> tag uses various attributes such as background, bgcolor etc.

2.

Which tag do we use to change the size and style (face) of the text of an HTML file viewed on a Web browser? Also, explain any two attributes used with this tag.

Answer»

<FONT> tag is used to change the size and style (face) of the text of an HTML file displayed on a Web browser. Two attributes of <FONT> tag are as follows:

size: It specifies the size of the text inside a <FONT> tag.

Syntax

<F0NT size=“number”>

face: It specifies the font name of the text inside a <FONT> tag.

Syntax

<FONT face=“Font_family”>

3.

Differentiate between container and empty elements used in HTML.

Answer»

Container elements HTML container elements require a starting as well as an ending tags.

e-g <HTML>, <HEAD>, <BODY>.

They affect the text appearing between their starting and ending tags.

Empty elements HTML empty elements require just a starting tag and not an ending tag.

e.g.

<IMG> , <BR> , <HR>.

They just carry out the job assigned to them.

4.

Which heading element gives the most prominent headings?

Answer»

<H1> heading element gives the most prominent headings.

5.

What is the purpose of using the tags &lt;H1&gt;…&lt;H6&gt;?

Answer»

<HTML> provides six levels of headings. <H1> is the largest heading level while <H6> is the smallest heading level. These headings help us in obtaining a uniform look and feel for the document.

6.

What is the method of using headings in HTML?

Answer»

<HTML> provides six levels of headings. <H1> is the largest heading level while <H6> is the smallest heading level. These headings help us in obtaining a uniform look and feel for the document.

7.

Write the difference between &lt;H1&gt; and &lt;H6&gt; heading tags.

Answer»

<HTML> provides six levels of headings. <H1> is the largest heading level while <H6> is the smallest heading level. These headings help us in obtaining a uniform look and feel for the document.

8.

Why are comment included in HTML document? With the help of an example, explain how they are included in HTML code?

Answer»

Comments are inserted in HTML code with the help of <!—….—> tag. To insert the text as a comment, type the text between <!– and —> tag, then that text will be ignored by the browser and invisible for the user.

e.g.

<HTML><BODY>

<!--This is a comment.-->

This is a book

</BODY><HTML>

9.

How are comments inserted in HTML code? Explain with an example.

Answer»

Comments are inserted in HTML code with the help of <!—….—> tag. To insert the text as a comment, type the text between <!– and —> tag, then that text will be ignored by the browser and invisible for the user.

e.g.

<HTML><BODY>

<!--This is a comment.-->

This is a book

</BODY><HTML>

10.

Name the values that can be used in valign attribute.

Answer»

The values that can be used in valign attribute are top, middle and bottom.

11.

Identify which one is an attribute or a tag?1. Body2. Type3. Br4. Link5. Face

Answer»

1. Body – Tag

2. Type – Attribute

3. Br – Tag

4. Link – Attribute

5. Face – Attribute

12.

Definition list has how many parts? (a) 5 (b) 4 (c) 3 (d) 2

Answer»

Correct answer is (d) 2

13.

Match the following :(A)tfoot(i)Order list(B)start(ii)Hyperlink(c)href(iii)Highlight(d)mark(iv)Table (A)(B)(C)(D)(a)(iv)(i)(ii)(iii)(b)(i)(iv)(iii)(ii)(c)(iv)(iii)(ii)(i)(d)(i)(ii)(iv)(iii) 

Answer»

(d) (i) (ii) (iv) (iii)

14.

which tag  with align attribute is used?

Answer»

The align attribute is used with both <td> tag and <table> tag.

15.

What is the use of align attribute in &lt; table &gt; tag?

Answer»

The align attribute defines the center, right or left alignment of the <table> tag.

16.

Which of these tags belong to table?(a) &lt;thead&gt;,&lt;body&gt;,&lt;tr&gt;(b) &lt;table&gt;,&lt;head&gt;,&lt;tfoot&gt;(c) &lt;table&gt;,&lt;tr&gt;,&lt;td&gt;(d) &lt;table&gt;,&lt;tr&gt;,&lt;tt&gt;

Answer»

(c),<table>,<tr>, <td> tags are used with table.

17.

Carefully study the Web page given here. Identify 10 tags (Structural as well as formatting tags) that have been utilized in creating this Web page and write usage of each of them.

Answer»

1. <HTML>……….</HTML> It encloses the entire HTML document and tells the browser that it is reading an HTML document and to display as such. 

2. <HEAD>………</HEAD> It encloses the head of the HTML document and it is used to contain face information about the document. 

3. <TITLE>…..</TITLE> It indicates the title of the document and appears in a browser’s bookmark file. 

4. <BODY>……</BODY> It is used to enclose the body (text, images, tags, links) of the HTML document. 

5. <H1>………</H1> It is used to define the heading level 1. 

6. <UL>…….</UL> It is used to create an unordered list. 

7. <LI>…..</LI> It is used to define each list item in the list. 

8. <U>…..</U> It is used to underline the text. 

9. <HR> It is used to insert a horizontal line. 

10. <CENTER>….. </CENTER> This tag is used to align the text centrally.

18.

Write the HTML code to set the bgcolor as pink, heading level 2, text This is pink background’ as black and topmargin 60.

Answer»

<HTML>

<BODY bgcolor = "pink” topmargin=“60” text= “black”>

<H2>This is pink background</H2>

</BODY >

</HTML>

19.

The &lt;thead&gt; tag is used to specify the………..part of the table.

Answer»

The <thead> tag is used to specify the header part of the table.

20.

The attribute topmargin sets a margin along with the top of your ………… element.

Answer»

The attribute topmargin sets a margin along with the top of your BODY element.

21.

color is an attribute of &lt;FONT&gt; tag.

Answer»

True It defines color of the text.

22.

Which attribute is not supported by a &lt;BODY&gt; tag?(a) bgcolor(b) size(c) text(d) link

Answer»

(b) size is not an attribute of <BODY> tag.

23.

The &lt;tr&gt; tag can only be present inside…………tag.

Answer»

The <tr> tag can only be present inside <table> tag.

24.

bgcolor is an attribute of &lt;FONT&gt; tag.

Answer»

False It is an attribute of the <BODY> tag.

25.

topmargin is used to specify the distance between the top of the document and top of the browser window.

Answer»

True topmargin is an attribute of the <BODY> tag, which is used to specify the distance between the top of the document and top of the browser window.

26.

&lt;td&gt; tag can only be present inside……….

Answer»

<td> tag can only be present inside <tr>

27.

The……………… attribute is used to align the data vertically within cells.

Answer»

The valign attribute is used to align the data vertically within cells.

28.

The……………… attribute is used to span two or more columns in a table.

Answer»

The colspan attribute is used to span two or more columns in a table.

29.

Table row &lt;tr&gt; tag can accept one attribute.

Answer»

False The <tr> tag can accept many attributes.

30.

Identify which of the following is a tag or an attribute ?1. link2. table3. align4. href5. br

Answer»

1. link — attribute

2. table — tag

3. align — attribute

4. href— attribute

5. br — tag

31.

background attribute is used to display image.

Answer»

True It is an attribute of <BODY> tag used to display the background image.

32.

The….. is an attribute of the &lt; table &gt; tag to set the distance between the cell content and its boundary.

Answer»

The cellpadding is an attribute of the < table > tag to set the distance between the cell content and its boundary.

33.

The………………. attributes is used to combine the cells vertically.

Answer»

The rowspan attributes is used to combine the cells vertically.

34.

To set image as background of an HTML table, you can use………………… attribute.

Answer»

To set image as background of an HTML table, you can use background attribute.

35.

Name two table attributes, which are used to set spacing in and between table cells.

Answer»

The cell spacing and cellpadding are the attributes, which are used to set spacing in and between the table cells.

36.

HTML tag for row is(a) &lt;colspan&gt;(b) &lt;tr&gt;(c) &lt;rowspan&gt;(d) &lt;td&gt;

Answer»

(b) HTML tag for row is <tr>.

37.

The rowspan attribute with &lt; table &gt; tag is used to merge more than one cells row wise.

Answer»

True The rowspan attribute merges the cells row wise in a table.

38.

rowspan = n can be added to only which tag?(a) &lt;hr&gt;(b) &lt;table&gt;(c) &lt;td&gt;(d) &lt;tr&gt;

Answer»

(c) rowspan = n can be added to only <td> tag.

39.

colspan = n can be added to tag.(a) &lt;hr&gt;(b) &lt; table &gt;(c) &lt;td&gt;(d) &lt;tr&gt;

Answer»

(d) colspan = n can be added to <td> tag.

40.

Which tag is used to add columns in the tables?(a) &lt;colspan&gt;(b) &lt;td&gt;(c) &lt;tr&gt;(d) None of these

Answer»

(b) <td> is used to add columns in the tables.

41.

Which attribute is used to specify the width of a cell in terms of pixels or percentage?(a) Width(b) Align(c) VAlign(d) &lt;Rowspan&gt;

Answer»

Correct answer is (a) Width

42.

Which attribute of &lt;td&gt; tag is used to merge two or more columns to form a single column?(a) colspan(b) cellspacing(c) cellpadding(d) rowspan

Answer»

(a) colspan attribute is used to merge two or more columns to form a single column.

43.

Define cellspacing.

Answer»

The cellspacing is used to create space between different cells in a table.

44.

By default, color of a table is…………..

Answer»

By default, color of a table is white

45.

Which attribute is used to specify the vertical alignment of the contents within a cell?(a) Width(b) Align(c) VAlign(d) &lt;Rowspan&gt;

Answer»

Correct answer is (c) VAlign

46.

The cellspacing attribute tells the browser how much space to include between the walls of the table.

Answer»

False cellspacing attribute is used to create space between different cells in a table.

47.

frame attribute is used with…………attribute.

Answer»

frame attribute is used with border attribute.

48.

The height and width attributes of &lt; table &gt; tag are specified in terms of………….. or percentage.

Answer»

The height and width attributes of < table > tag are specified in terms of pixel or percentage.

49.

Which attribute is used to set the space between the contents of a cell and its border?(a) Cellspacing(b) Cellpading(c) Alig(d) Height

Answer»

(b) Cellpading

50.

Name any two values specified in frame attribute.

Answer»

The values that can be specified for frame attribute are void and above.