Digital Learning

Tuesday, December 28, 2021

CBSE Computer-Science Class-VIII (Solved Exercise-9):

Computer Science
Class-VIII
Chapter-9 Inserting Images into Web Pages

Section-1

A. Answer these questions orally:
1. Why do you insert an image into a web page?
Answer: We insert an image into a Web page to enhances the looks of the web page.

2. What is the use of align attribute?
Answer: Align attribute used to position the image in a Web page.

3. How will you specify height and width of an image?
Answer: We can specify height and width of an image either in the form of an integer or as a percentage of the height.

B. Tick the correct option.
1. Inserting an _______ into a web page enhances the looks of the web page.
a. image         b. angle        c. axle            d. none of these
Answer: Image

2. URL gives the path of the ___________ containing the image.
a. book           b. file            c. border        d. none of these
Answer: File

3. Border attribute allows you to add a _______ around the image.
Answer: Border

Section-2

A. Fill in the blanks:
1. The _________ tag specifies an image to be displayed in an HTML document.
Answer: <IMG>

2. The most widely used formats for inserting images in web pages are _____ and _______.
Answer: .jpg, .gif

3. The align attribute can take the values ____________.
Answer: left, right, top, bottom, middle.

4. SRC is one of the attribute of __________ element.
Answer: <IMG>

5. The height and width of the picture can be specified in the _______ tag.
Answer: <IMG>

B. Correct the following HTML code:
<HTML>
<HEAD><TITLE> This is a test
<IMG SRC="sky.gif">
</HTML>
Answer: 
<HTML>
<HEAD>
<TITLE> This is a test
</TITLE>
</HEAD>
<BODY>
<IMG SRC="sky.gif">
</BODY>
</HTML>

C. Answer the following questions:
1. Can you insert an image in an HTML document? If yes, how?
Answer: Yes, To insert an image in a web page the <IMG> tag is added to an HTML code.
Syntax: <IMG src="URL>

2. What is alternative text? Explain with an example.
Answer: Alternative text is a text that appear in the page if the image does not appear.
Syntax: <IMG src="URL" alt="Alternative text>

3. What attributes will you use to achieve the following? Discuss with examples.
a. Right align an image in the Web page.
Answer: To align an image the align attribute is used.
Example:
<HTML>
<HEAD>
<TITLE>
ALIGNMENT
</TITLE>
</HEAD>
<BODY>
<IMG src="PIC1.GIF" ALIGN=RIGHT>
</BODY>
</HTML>

b. Add border to an image.
Answer: The border attribute is used to create a border.
Example:
<HTML>
<HEAD>
<TITLE>
ALIGNMENT
</TITLE>
</HEAD>
<BODY>
<IMG src="PIC1.GIF" BORDER=4>
</BODY>
</HTML>

c. Specify the height of an image.
Answer: The height attribute is used to specify height of an image.
Example:
<HTML>
<HEAD>
<TITLE>
ALIGNMENT
</TITLE>
</HEAD>
<BODY>
<IMG src="PIC1.GIF" height=40%>
</BODY>
</HTML>
d. Specify the width of an image.
Answer: The width of an image can be specified using the width attribute.

No comments:

Post a Comment