Q1. To jump to new page, we use
(a) <IMG> tag
(b) <A> tag
(c) <JUMP> tag
(d) none of the above
Ans. (b) <A> tag
The anchor tag <A> is used to link a hypertext to a new document or jump to a new page.
Q2. Which of the following is not a valid value for align attribute of <IMG> ?
(a) top
(b) middle
(c) bottom
(d) center
Ans. (d) center
The align attribute of <IMG> tag takes top, middle and bottom values. The value 'center' is not used.
Q3. For linking to another web page, its URL is specified with ............... attribute of <A> tag.
(a) href
(b) title
(c) name
(d) none of the above
Ans. (a) href
For linking to another web page, its URL is specified with href attribute of <A> tag.
Q4. ............... attribute is used to specify the location of an image file.
(a) alt
(b) src
(c) align
(d) name
Ans. (b) src
src attribute is used to specify the location of an image file.
Q5. The default alignment of images, that are inserted in the web page, is ............... .
(a) left
(b) right
(c) middle
(d) inline with text
Ans. (d) inline with text
The default alignment of images, that are inserted in the web page, is inline with text.
Q6. To create a link you surround the text or image with a(n) ............... tag.
(a) link
(b) anchor
(c) reference
(d) target
Ans. (b) anchor
To create a link you surround the text or image with a(n) anchor (<A>) tag.
Q7. The correct HTML code to display (P + Q)2 is:
(a) <SUB> ( P+) 2 </SUB>
(b) P+Q <SUP> 2 </SUP>
(c) (P + Q) <SUP> 2 </SUP>
(d) <SUP> (P+Q) 2 </SUP>
Ans. (c) (P + Q) <SUP> 2 </SUP>
The superscript tag <SUP> is used to write (P + Q)2 by using the command —
(P + Q) <SUP> 2 </SUP>
Q8. The tag that starts a table cell is ............... .
(a) <table>
(b) <tc>
(c) <td>
(d) <tr>
Ans. (c) <td>
The tag that starts a table cell is <td> tag.
Q9. Choose the correct HTML to left-align the content inside a table cell.
(a) <td valign="left">
(b) <tdleft>
(c) <td align="left">
(d) <td leftalign>
Ans. (c) <td align="left">
The "align" attribute is used to specify the horizontal alignment of the content within a table cell. By setting the "align" attribute to "left", the content inside the <td> tag will be left-aligned.
Q10. What is required to create a reference to a remote site that is different from creating a local link ?
(a) The remote attribute
(b) A link title
(c) The Web address of the remote site
(d) An extra <a> tag
Ans. (c) The Web address of the remote site
When creating a reference to a remote site, the URL of the remote site needs to be specified as the value of the href attribute in the <a> tag.
Q1. Name various types of alignments available for images.
Ans. The various types of alignments available for images are:
- Top alignment
- Middle alignment
- Bottom alignment
- Left and Right alignment
Q2. Which attribute of <A> facilitates internal linking ?
Ans. The attributes of <A> tag which facilitate internal linking are:
- name — It is used to identify a segment of the document to which a link is to be established.
- href — It is used to link to the named section.
Q3. Write HTML code to create the following ordered list:
X. Xylophone
Y. Yak
Z. Zebra
Ans.
<OL TYPE = "A" START = "24">
<LI> Xylophone </LI>
<LI> Yak </LI>
<LI> Zebra </LI>
</OL>
Q4. Write the HTML code to create the following indentation effect:
Apple pie,
pudding,
and pancake,
All begin with an A.
Ans.
Apple pie, <BR>
pudding, <BR>
and pancake, <BR>
All begin with an A.
Q5. How would you make the word Elephant appear whenever the actual elephant.jpg image couldn't be displayed by a Web browser ?
Ans. We can do this by setting the value of alt attribute to 'Elephant' in the following way:
<IMG SRC = "ELEPHANT.JPG" ALT = "ELEPHANT">
Q6. How would you insert an image file named elephant.jpg at the very top of a Web page ?
Ans. To insert the image at the very top of a Web page, the align attribute of <IMG> tag should be set to "top" in the following way:
<IMG SRC = "ELEPHANT.JPG" ALIGN = "TOP">
Q7. Your home page will be at http://www.mysite.com/home.htm when you put it on the Internet. Write the HTML code to go on that page so that when someone clicks the words All About Me, they see the page located at http://www.mysite.com/mylife.htm.
Ans. The command to perform the given task is as follows:
<A HREF = "mylife.htm"> All About Me </A>
Q8. Name the following with respect to HTML:
Element to create a hyperlink.
Ans. Anchor tag <A>...</A>
Q9. Which attributes are used to give border to a table ?
Ans. The attributes which are used to give border to a table are:
border — This attribute tells the table how large the border should be.
frame — This attribute is used with border attribute and it allows the user to state which portions of the border will be displayed by the browser.
rules — It is used with border attribute and it allows the user to state which portions of the inside border edges will be displayed.
bordercolor — This attribute is used to specify the color of a table's border.
Q10. Which attribute is used to control the inside table border ?
Ans. Rules attribute is used to control the inside table border.
Q11. What is the role of ALIGN attribute of <TABLE> tag ?
Ans. Align attribute of <TABLE> tag is used to align the table on a web page. It can have the following values — left, right and center. These values indicate whether the table should be placed flush against the left or right margin of the text flow, with the text flowing around the table or in the middle with the text flow above and below.
Q12. How can you specify following in a table:
(i) background image
(ii) background colour
(iii) table height
(iv) table width ?
Ans. (i) background attribute is used to specify the background image in a table.
(ii) bgcolor attribute is used to specify the background color in a table.
(iii) height attribute is used to specify the height of a table.
(iv) width attribute is used to specify the width of a table.
Q13. Name the attributes used for following:
(i) Setting the cell width
(ii) Setting cell's background image
(iii) Setting cell's background colour
(iv) Changing the cell span
(v) Aligning cell contents vertically.
Ans.
(i) width
(ii) background
(iii) bgcolor
(iv) rowspan and colspan
(v) valign
Q14. A set of header rows is defined using ............... tag.
Ans. A set of header rows is defined using <THEAD> tag.
Q15. What attributes can you use with TABLE tag but not with TR tag ?
Ans. We can use the following attributes with TABLE tag but not with TR tag —
- summary
- rules
- frame
- border
- bordercolor
- cellpadding
- cellspacing
- height
- width
Q16. How do you create different table section ?
Ans. The <THEAD>, <TBODY> and <TFOOT> tags are used to divide HTML tables in different sections. While the <THEAD> and <TFOOT> tags define the header and footer sections , the <TBODY> tag defines the body section of the table.
Consider the following example:
<HTML>
<BODY>
<TABLE>
<THEAD BGCOLOR = "PINK">
<TR>
<TD> Header </TD> <TD> Header </TD>
</TR>
</THEAD>
<TBODY BGCOLOR = "YELLOW">
<TR>
<TD> Body cell data </TD> <TD> Body cell data </TD>
</TR>
<TR>
<TD> Body cell data </TD> <TD> Body cell data </TD>
</TR>
</TBODY>
<TFOOT>
<TR>
<TD> Footer </TD> <TD> Footer </TD>
</TR>
</TFOOT>
</TABLE>
</BODY>
</HTML>
Q17. Write HTML code to produce following table:
Ans.
<HTML>
<BODY>
<TABLE frame = "void" rules = "all">
<TR> <TD> A </TD> <TD> D </TD> </TR>
<TR> <TD> B </TD> <TD> E </TD> </TR>
<TR> <TD> C </TD> <TD> F </TD> </TR>
</TABLE>
</BODY>
</HTML>
Q18. Which tag is used to specify
(i) table data ?
(ii) table header ?
(iii) table row ?
Ans.
(i) <TD> tag
(ii) <TH> tag
(iii) <TR> tag
Q19. Write HTML code to produce following table:
Ans.
<HTML>
<BODY>
<TABLE frame = "above" rules = "all">
<TR> <TD> A </TD> <TD> B</TD><TD> C </TD> <TD> D </TD></TR>
<TR> <TD> E </TD> <TD> F </TD> <TD> G </TD> <TD> H </TD></TR>
</TABLE>
</BODY>
</HTML>
Q20. Write code to produce following HTML table:
Ans.
<HTML>
<BODY>
<TABLE>
<TR ALIGN = "CENTER">
<TD> A </TD>
<TD COLSPAN = "3"> B </TD>
</TR>
<TR ALIGN = "CENTER">
<TD> C </TD>
<TD> D </TD>
<TD> E </TD>
<TD ROWSPAN = "2"> H </TD>
</TR>
<TR ALIGN = "CENTER">
<TD> C </TD>
<TD COLSPAN = "2"> H </TD>
</TR>
</TABLE>
</BODY>
</HTML>
10 videos|97 docs|18 tests
|
1. What is HTML and why is it important in web development? | ![]() |
2. What are the main elements of HTML? | ![]() |
3. How do CSS and JavaScript complement HTML? | ![]() |
4. What are HTML forms and how are they used? | ![]() |
5. What is the significance of semantic HTML? | ![]() |