0% found this document useful (0 votes)
224 views23 pages

Class-X CH-4 HTML Images, Link and Tables

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
224 views23 pages

Class-X CH-4 HTML Images, Link and Tables

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Chapter 4

HTML II — Images, Links and Tables


Class 10 - Sumita Arora CBSE Computer Code 165

Objective Type Questions

Question 1

To jump to new page, we use

1. <IMG> tag
2. <A> tag
3. <JUMP> tag
4. none of the above

Answer

<A> tag
Reason — The anchor tag <A> is used to link a hypertext to a new document or jump to a new
page.

Question 2

Which of the following is not a valid value for align attribute of <IMG> ?

1. top
2. middle
3. bottom
4. center

Answer

center

Reason — The align attribute of <IMG> tag takes top, middle and bottom values. The value
'center' is not used.

Question 3
If the image you are loading in the web page is not available, then you want a text to appear in
the image place holder, which attribute lets you define this text ?

1. src
2. align
3. text
4. alt

Answer

alt

Reason — The alt attribute specifies alternate text the browser may show if the image display is
not possible or disabled by the user.

Question 4

For linking to another web page, its URL is specified with ............... attribute of <A> tag.

1. href
2. title
3. name
4. none of the above

Answer

href

Reason — For linking to another web page, its URL is specified with href attribute of <A> tag.

Question 5

For internal linking, the section names are provided by ............... attribute of <A> tag ?

1. href
2. title
3. name
4. none of the above

Answer

name

Reason — For internal linking, the section names are provided by name attribute of <A> tag.
Question 6

............... attribute is used to specify the location of an image file.

1. alt
2. src
3. align
4. name

Answer

src

Reason — src attribute is used to specify the location of an image file.

Question 7

The ............... attribute of <img> tag specifies an alternate text for an image, if the image cannot
be displayed due to any reason.

1. alt
2. alternate
3. tooltip
4. text

Answer

alt

Reason — The alt attribute of <img> tag specifies an alternate text for an image, if the image
cannot be displayed due to any reason.

Question 8

The default alignment of images, that are inserted in the web page, is ............... .

1. left
2. right
3. middle
4. inline with text

Answer

inline with text


Reason — The default alignment of images, that are inserted in the web page, is inline with text.

Question 9

While creating a Web document, which unit is used to express an image's height and width ?

1. Centimetres
2. Pixels
3. Dots per inch
4. Inches

Answer

Pixels

Reason — While creating a Web document, pixels are used to express an image's height and
width.

Question 10

The default alignment of images, that are inserted in Web page, is :

1. Left
2. Right
3. Inline with text
4. Middle

Answer

Inline with text

Reason — The default alignment of images, that are inserted in Web page, is inline with text.

Question 11

Border, frame, cellspacing, cellpadding, align are the attributes of :

1. <BODY>
2. <IMG>
3. <TABLE>
4. None of these

Answer

<TABLE>
Reason — Border, frame, cellspacing, cellpadding, align are the attributes of <TABLE> tag.

Question 12

To create a link you surround the text or image with a(n) ............... tag.

1. link
2. anchor
3. reference
4. target

Answer

anchor

Reason — To create a link you surround the text or image with a(n) anchor (<A>) tag.

Question 13

The correct HTML code for inserting an image is :

1. <img href ="image.gif">


2. <img> image.gif </gif>
3. <image src = "image.gif">
4. <img src = "image.gif">

Answer

<img src = "image.gif">


Reason — The correct HTML code for inserting an image is :

<img src = "image.gif">

Question 14

Which will let text wrap down the side of the image?

1. <img src="myImage.gif" align="wrap">


2. <img src="myImage.gif" align="right">
3. <img src="myImage.gif" wrap="on">

Answer

<img src="myImage.gif" align="right">


Reason — 'src' attribute specifies the URL of the image file and 'align = right' tells the browser
to place an image against the right margin.
Question 15

Consider the following code :

<img src ="Computers.jpg" width ="...." height ="....">


Fill in the blanks to set the image size to be 250 pixels wide and 400 pixels tall.

1. 250, 400
2. 400, 250
3. <250><400>
4. <400><250>

Answer

250, 400

Reason — The 'height' and 'width' attribute of <IMG> tag tell the browser to reserve space before
actually downloading an image.
<img src ="Computers.jpg" width ="250" height ="400">
The above command tells the browser to reserve the image place with a width of 250 pixels and
a height of 400 pixels.

Question 16

The correct HTML code to display (P + Q)2 is:

1. <SUB> ( P+) 2 </SUB>


2. P+Q <SUP> 2 </SUP>
3. (P + Q) <SUP> 2 </SUP>
4. <SUP> (P+Q) 2 </SUP>

Answer

(P + Q) <SUP> 2 </SUP>
Reason — The superscript tag <SUP> is used to write (P + Q)2 by using the command —
(P + Q) <SUP> 2 </SUP>

Question 17

The < ............... > tag displays text in subscript form.

1. sub
2. sup
3. sups
4. subs
Answer

sub

Reason — The <SUB> tag displays text in subscript form.

Question 18

The tag that starts a table cell is ............... .

1. <table>
2. <tc>
3. <td>
4. <tr>

Answer

<table>
Reason — The tag that starts a table cell is <table> tag.

Question 19

What tag is used to add columns to tables ?

1. <colspan>
2. <td>
3. <tr>

Answer

<td>
Reason — <td> tag is used to add columns to tables.

Question 20

Which has higher priority, cell settings or table settings ?

1. Neither
2. Cell settings
3. Table settings

Answer

Cell settings

Reason — Cell settings have higher priority than table settings.


Question 21

Choose the correct HTML to left-align the content inside a table cell.

1. <td valign="left">
2. <tdleft>
3. <td align="left">
4. <td leftalign>

Answer

<td align="left">
Reason — 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.

Question 22

Which of these tags are all <table> tags ?

1. <thead><body><tr>
2. <table><tr><td>
3. <table><head><tfoot>
4. <table><tr><tt>

Answer

<table><tr><td>
Reason — The <table> tag is used to define tables, <tr> tag is used to define table rows and
the <td> tag is used to define data cells.

Question 23

Settings for columns(<td> tag) have higher priority than settings for rows(<tr> tag).

1. Sometimes true, sometimes not


2. True
3. False

Answer

True

Reason — In HTML, the <td> tag is used to define a cell within a table, while the <tr> tag is
used to define a row. When applying settings to cells and rows, the settings applied directly to
the <td> tag will take precedence over settings applied to the <tr> tag.
Question 24

Which property tells how many rows a cell should span ?

1. colspan = n
2. Both rowspan = n and colspan = n
3. rowspan = n

Answer

rowspan = n

Reason — rowspan attribute specifies the number of rows a cell should span.

Question 25

What is required to create a reference to a remote site that is different from creating a local link ?

1. The remote attribute


2. A link title
3. The Web address of the remote site
4. An extra <a> tag

Answer

The Web address of the remote site

Reason — 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.

Question 26

Which one of the following is the list type that will create a bulleted list ?

1. unordered
2. option
3. decorated
4. ordered

Answer

unordered

Reason — An unordered list type will create a bulleted list.


Question 27

Why is it important to specify an image width and height in an <img> tag ?

1. It ensures that a user will not be able to copy the image to their computer.
2. The image will not render if these attributes are left out.
3. These attributes constrain the image's proportions.
4. Specifying these dimensions helps a browser render pages faster.

Answer

Specifying these dimensions helps a browser render pages faster.

Reason — Specifying the width and height of the image enables the browser to reserve space
before actually downloading the image, speeding document rendering and eliminating the
content shifting.

Question 28

Which one of the following HTML tags is surrounded by <a></a> container tags to create an
image link ?

1. <img>
2. <ul>
3. <br>
4. <pic>

Answer

<img>
Reason — <img> tag is surrounded by <a></a> container tags to create an image link .

Question 29

What is the general syntax for inline image ?

1. <src = img>
2. <src = image>
3. <img = file>
4. <img src = file>
5. <image src = file>

Answer

<img src = file>


Reason — The <img> tag is used to insert images in HTML, and the "src" attribute is used to
specify the path or URL of the image file. Therefore, the correct syntax for an inline image is:
<img src = file>

Question 30

To create a link to an anchor, you use the ............... property in A tag.

1. Name
2. Tag
3. Link
4. Href

Answer

Href

Reason — The href property in <A> tag is used to create a link to an anchor.

Question 31

Which of the following is used to specify the beginning of a table's row ?

1. TROW
2. TABLER
3. TR
4. ROW

Answer

TR

Reason — <TR> tag is used to specify the beginning of a table's row.

Question 32

In order to add border to a table, BORDER attribute is specified in which tag ?

1. THEAD
2. TABLE
3. TBORDER
4. none of these

Answer
TABLE

Reason — In order to add border to a table, BORDER attribute is specified in <TABLE> tag in
the following manner:
<TABLE BORDER = "2">
... contents ...
</TABLE>

Question 33

Which of the following is an attribute of <Table> tag ?

1. SRC
2. LINK
3. CELLPADDING
4. BOLD

Answer

CELLPADDING

Reason — 'Cellpadding' is an attribute of <TABLE> which gives the amount of space between
the cell border and the cell contents.

Question 34

What is the correct syntax in HTML for creating a link on a webpage ?

1. <LINK SRC = "abc.html">


2. <BODY LINK = "abc.html">
3. <A SRC = "abc.html">
4. <A HREF = "abc.html">

Answer

<A HREF = "abc.html">


Reason — In HTML, the <a> tag is used to create a hyperlink, or link, on a webpage.
The href attribute is used within the <a> tag to specify the destination of the link.

Question 35

Choose the correct HTML code to create an email link ?

1. <A HREF = "[email protected]"></A>


2. <A HREF = "mailto:[email protected]"></A>
3. <MAIL = "[email protected]"></MAIL>
4. <A MAILHREF = "[email protected]"></A>

Answer

<A HREF = "mailto:[email protected]"></A>


Reason — In HTML, to create an email link, we need to use the mailto: protocol followed by
the email address. This protocol tells the browser to open the default email client with a new
message addressed to the specified email address.

Question 36

............... attribute is used with <A> tag to specify the URL of link.
Answer

href attribute is used with <A> tag to specify the URL of link.

Question 37

No value is specified with ALT attribute of <IMG> tag. (T/F)


Answer

False

Reason — The alt attribute specifies alternate text the browser may show if the image display is
not possible or disabled by the user.

Question 38

ROWSPAN with <TABLE> tag is used to merge more than one cell row wise. (T/F)
Answer

False

Reason — ROWSPAN with <TD> tag is used to merge more than one cell row wise.

Question 39

Target attribute with <A> tag is used to open a link in a new window. (T/F)
Answer

True

Reason — By setting the target attribute to "_blank", the link will open in a new window or tab,
depending on the user's browser settings. For example:
<a href="example.com" target="_blank">Open in New Window</a>
Question 40

Align and Valign are the attributes used with <TD> tag to set the alignment of data in a table.
(T/F)
Answer

True

Reason — Align attribute is used to control the horizontal alignment of the contents of a cell and
Valign is used to control the vertical alignment of the contents of a cell.

Question 41

BORDER is an attribute of <A> tag. (T/F)


Answer

False

Reason — BORDER is an attribute of <TABLE> tag.


Theoretical Questions

Question 1

What is meant by inline images in HTML ?

Answer

Inline image means that image displays in line with the text, i.e., the specified image is loaded
separately and placed into the text flow as if the image were some special character.

Question 2

Name various types of alignments available for images.

Answer

The various types of alignments available for images are:

1. Top alignment
2. Middle alignment
3. Bottom alignment
4. Left and Right alignment

Question 3
Which attributes of <A> facilitates external linking ?
Answer

The attributes of <A> tag which facilitate external linking are:

1. href — It is used to specify the URL of the target of the link.


2. title — It specifies a title for the document to which one is linking.

Question 4

Which attribute of <A> facilitates internal linking ?


Answer

The attributes of <A> tag which facilitate internal linking are:

1. name — It is used to identify a segment of the document to which a link is to be


established.
2. href — It is used to link to the named section.

Question 5

What for is Mailto function used ?

Answer

The "mailto" function is used to create email links on webpages, allowing users to click on the
link and open their default email client with a new message addressed to the specified email
address.

Question 6

Write HTML code to create the following ordered list :

X. Xylophone
Y. Yak
Z. Zebra

Answer

<OL TYPE = "A" START = "24">


<LI> Xylophone </LI>
<LI> Yak </LI>
<LI> Zebra </LI>
</OL>

Question 7
How would you indent a single word and put a square bullet in front of it ?

Answer

To indent a single word and put a square bullet in front of it, we can use an unordered list in the
following way:

<UL TYPE = "SQUARE">


<LI> Word </LI>
</UL>

Question 8

Write the HTML code to create the following indentation effect :

Apple pie,
pudding,
and pancake,
All begin with an A.
Answer

Apple pie, <BR>


pudding, <BR>
and pancake, <BR>
All begin with an A.

Question 9

Use a definition list in a table to show that the word "glunch" means "a look of disdain, anger, or
displeasure" and that the word "glumpy" means "sullen, morose, or sulky."

Answer

<HTML>
<BODY>
<TABLE>
<TR>
<TD>
<DL>
<DT> Glunch </DT>
<DD> a look of disdain, anger, or displeasure</DD>
</DL>
</TD>
</TR>
<TR>
<TD>
<DL>
<DT> Glumpy </DT>
<DD> sullen, morose, or sulky</DD>
</DL>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

Question 10

How would you make the word Elephant appear whenever the actual elephant.jpg image couldn't
be displayed by a Web browser ?

Answer

We can do this by setting the value of alt attribute to 'Elephant' in the following way:

<IMG SRC = "ELEPHANT.JPG" ALT = "ELEPHANT">

Question 11

Write the HTML to make the elephant.jpg image appear on the right side of the page, with a big
headline reading "Elephants of the World Unit!" on the left side of the page next to it.

Answer

<H1>Elephants of the World Unit!<IMG SRC = "ELEPHANT.JPG" ALIGN =


"RIGHT"></H1>

Question 12

How would you insert an image file named elephant.jpg at the very top of a Web page ?

Answer

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">

Question 13

Suppose you have a large picture of a standing elephant named elephant.jpg. Now make a small
named fly.jpg appear to the left of the elephant's head and mouse.jpg appear next to the
elephant's right foot.

Answer
The HTML code to perform the given task is as follows:

<IMG SRC = "FLY.JPG" ALIGN = "TOP"><IMG SRC = "ELEPHANT.JPG"><IMG SRC


= "MOUSE.JPG" ALIGN = "BOTTOM">

Question 14

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.
Answer

The command to perform the given task is as follows:

<A HREF = "mylife.htm"> All About Me </A>

Question 15

You plan to publish a CD-ROM disk containing HTML pages. How do you create a link from a
page in the \guide folder to the \ guide \ mains \ kolkata.htm page ?

Answer

<A HREF = "mains/kolkata.htm"> Kolkata </A>

Question 16

Name the following with respect to HTML :

Element to create a hyperlink.

Answer

Anchor tag <A>...</A>

Question 17

What is a table ? Which tag is used to create tables in HTML ?

Answer

An HTML table allows a user to arrange data — text, preformatted text, images, links, forms,
form fields, other tables, etc., into rows and columns of cells.

The table tag <TABLE>...</TABLE> is used to create tables in HTML.

Question 18
Which attributes are used to give border to a table ?

Answer

The attributes which are used to give border to a table are:

1. border — This attribute tells the table how large the border should be.
2. 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.
3. rules — It is used with border attribute and it allows the user to state which portions of
the inside border edges will be displayed.
4. bordercolor — This attribute is used to specify the color of a table's border.

Question 19

Which attribute lets you control the display of select border sides of a table ?

Answer

Frame attribute lets us control the display of select border sides of a table.

Question 20

Which attribute is used to control the inside table border ?

Answer

Rules attribute is used to control the inside table border.

Question 21

How is spacing in cells of table controlled ?

Answer

To control the spacing of cells, the 'Cellspacing' and 'Cellpadding' attributes are used.

1. Cellspacing — It gives the amount of space between cells.


2. Cellpadding — It gives the amount of space between the cell border and the cell contents.

Consider the following example:

<TABLE BORDER = "3" CELLSPACING = "1" CELLPADDING = "1">


<TR> <TD> Fruits </TD> <TD> Vegetables </TD> </TR>
<TR> <TD> Mango, Apple, Banana </TD> <TD> Potato, Aubergine, Gourd
</TD> </TR>
</TABLE>

Question 22

What is the role of ALIGN attribute of <TABLE> tag ?


Answer

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.

Question 23

What is the use of having a SUMMARY attribute in <TABLE> tag ?


Answer

The summary attribute is used to provide a long description of the table's purpose. It is usually
given for the benefit of people using speech or Braille based user agents.

Question 24

How can you specify following in a table :

(i) background image

(ii) background colour

(iii) table height

(iv) table width ?

Answer

(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 fo a table.

Question 25

Which tag is used to specify

(i) table data ?

(ii) table header ?


(iii) table row ?

Answer

(i) <TD> tag


(ii) <TH> tag
(iii) <TR> tag

Question 26

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.

Answer

(i) width
(ii) background
(iii) bgcolor
(iv) rowspan and colspan
(v) valign

Question 27

What for are <TH> and <TR> tags used ?


Answer

<TH> tag stand for table header. The contents declared as header are displayed in a distinctive
style, like bold-faced.
<TR> tag stands for table row. <TR> marks the beginning of a table row and </TR> marks the
end of a table row.

Question 28

A set of header rows is defined using ............... tag.

Answer

A set of header rows is defined using <THEAD> tag.


Question 29

Which tags divide HTML tables in multiple sections ?

Answer

The <THEAD>, <TBODY> and <TFOOT> tags are used to divide HTML tables in multiple sections.
While the <THEAD> and <TFOOT> tags define the header and footer sections , the <TBODY> tag
defines the body section of the table.

Question 30

What attributes can you use with TABLE tag but not with TR tag ?

Answer

We can use the following attributes with TABLE tag but not with TR tag —

1. summary
2. rules
3. frame
4. border
5. bordercolor
6. cellpadding
7. cellspacing
8. height
9. width

Question 31

Can you insert hyperlinks inside table cells ?

Answer

Yes, we can insert hyperlinks inside table cells by using the anchor tag <A>...</A>.

Question 32

How do you create different table section ?

Answer

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>

Question 33

Write code to produce following HTML table :

Answer

<HTML>
<BODY>
<TABLE>
<TR> <TD ROWSPAN = "2"> A </TD> <TD> B </TD> </TR>
<TR> <TD> C </TD> </TR>
</TABLE>
</BODY>
</HTML>

You might also like