You are on page 1of 7

QUESTION BANK

Grade: VII Subject: Computer Studies


Topic: More on HTML

QI. Select the correct option:

1) Which of the following image formats are used in web pages?


i. GIF ii. JPEG
iii. PNG iv. all of these

2) This attribute of the <img> tag is used to specify the URL/path of the image.
i. Alt ii. border
iii. SRC iv. width

3) While creating a table, the __________ tag is used to add a title to the table.
i. <td> ii. <caption>
iii. <th> iv. <table>

4) Which attribute of the <td > tag is used to create merged cells across columns?
i. align ii. rowspan
iii. colspan iv. align

5) In a form, this button is used to clear all inputs given by a user.


i. submit ii. reset
iii. both (i) and (ii) iv. none of these

6) The cell spacing attribute specifies an extra space between the ________________.
i. cell and content ii. adjacent cells
iii. adjacent tables iv. none of these

7) In HTML, each row is defined using the _________ tag.


i. <TD> ii. <TR>
iii. <TH> iv. <CAPTION>

8) This attribute of the image tag is used to specify an alternate text if the image cannot be displayed.
i. Src ii. align
iii. Alt iv. none of these
9) In HTML, you can create a hyperlink using
i. Text ii. image
iii. both a. and b. iv. none of these

10) You can create a drop-down list in an HTML form by using the _________ element.
i. Input ii. select
iii. both a. and b. iv. none of these

11) JPEG is an acronym for


i. Join Photographic Experts Game
ii. Join Photogenic Exact Game
iii. Joint Photographic Experts Group
iv. Joint Photogenic Exact Group

12) This attribute of the table tag specifies extra space around the contents of a cell.
i. ALIGN ii. WIDTH
iii. CELLSPACING iv. CELLPADDING

13) ____________ _ is an interactive page which resembles a paper document containing textboxes,
option button, drop-down list, checkboxes and so on.
i. Form ii. Hyperlink
Iii. Image iv. Table

14) Links to a part or section of the same document are called ___________ links.
i. Lists ii. Internal Link
iii. External Links iv. Named Links

15) ___________ are text or pictures, which when clicked, open another web page or image or another
file linked to it.
i.Forms ii. Hyperlinks
iii. Images iv. Tables

16) The __________ attribute is used to merge two or more cells across the rows.
i. align ii. rowspan
iii. colspan iv. align

17) The _____________ tag is used to add a picture in a web page.


i. <IMG> ii. <TD>
iii. <TR> iv. <TH>
QII Answer the Following:

1. Write HTML code to insert an image with the following attributes in a web page.
URL of the image - angel.png
Alternate Text - Angel
Width of the image - 25
height of the image - 35
width of the border = 4
Ans: <html>
<body>
<img src="angel.png" alt="Angel" width="25" height="35" border=”4”>
</body>
</html>

2. Write the HTML code to create the table shown below.

Ans: <html>
<head>
<title>HTML table Tag</title>
</head>
<body>
<table border="1">
<tr>
<th>Teams</th>
<th>Ranking</th>
</tr>
<tr>
<td>India</td>
<td align = center>1</td>
</tr>
<tr>
<td>New Zealand</td>
<td align = center>2</td>
</tr>
<tr>
<td>Australia</td>
<td align = center>3</td>
</tr>
</table>
</body>
</html>

3. What is an HTML form? Explain its use.


Ans:
● An HTML form is a web page used to accept the user’s input.
● It is an interactive page that resembles a paper document containing textboxes, option button,
drop-down lists, checkboxes and so on.
● It can be used to enter online transaction details or to fill up an admission form for a school.

4. Name the different types of images that are used in web pages. Which image type is most suitable
for photographs? Why?
Ans: TIFF, GIF, JPEG, PNG. JPEG is most suitable for photographs as it can display a wide spectrum of
colors while still keeping the file size small.

5. What is the difference between internal and external links?


Ans:
Internal link External link

i. Internal links are links to a part or i. External links are links to another file.
section of the same document.

ii. The attribute ‘NAME’ is required for ii. Only ‘HREF’ attribute is required to
naming the linked section and ‘HREF’ for specify the filename to be linked.
specifying the section to be linked.

6. What are the elements that you can add in a HTML form?
Ans: Text fields, checkboxes, radio button, submit button and reset button.

7. Use an HTML tag to convert the image in the given code into a link.
When clicked, it should open the website www.gmail.com
Write the HTML code for the same <img src = “flower.jpg” alt=”flower” height=50 width=50>
Ans: <a href = “www.gmail.com”>
<img src = “flower.jpg” alt =”flower” height=50 width=50> </a>
8. Create a simple login page that contains two textboxes where the user will enter the name and
password. It must have a submit button.
Ans: <html>
<head><title> Login page</title></head>
<body>
<form action=”login.php” method=”get”>
Username <br><input type=”text’ name=”uname”> <br>
Password <br><input type=”text’ name=”pwd”> <br>
<br>
<input type="submit" name="sub">
</form></body></html>

9. How can you add a drop-down menu to select an elective subject in your school’s registration form?
Write the HTML code for the same.
Ans: I can create a drop-down list using the select element in HTML. For example : To create a drop
down menu in my school
registration form ‘Register.php’
<form action=”Register.php”>
<select name =”subject”>
<option value =”Subject_1”>Subject_1</option>
<option value =”Subject_2”>Subject_2</option>
<option value =”Subject_3”>Subject_3</option>
</select>
<br><br>
<input type="submit" name="sub">
</form>

10. Asha has created the following link in HTML.


<a href= “#Part I”>Introduction</a>
Identify the type of link. Explain the use of the name attribute of the <a> tag.
Ans. Internal link.
The ’name’ attribute is used to name the section of the document to be linked.

QIII. Do as Directed:

1. Identify the attribute of the table tag that should be used for the following i. Add an image as the
background of the table.
Ans. BACKGROUND
ii. Specify extra space around the contents of a cell.
Ans. CELLPADDING
2. Which attribute of the image tag should be used for the following?
a) Specify the thickness of the border around the image.
Ans. BORDER
b) Specify alternate text if the image cannot be displayed.
Ans. ALT

3. Observe the HTML code used to create the following table and answer the questions given below.

<TABLE BORDER =1>


<TR><TD> OpenOffice</TD>
<TD> </TD>
<TD> </TD></TR>
<TR><TD> Writer</TD>
<TD> Calc</TD>
<TD> Base </TD> </TR>
</TABLE>
i. Modify the table tag to set the image ‘openoffice.gif’ as the background of the table.
Ans. <TABLE BORDER =1 BACKGROUND=”openoffice.gif”>

ii. Modify the HTML code to merge cells across 3 columns and get the following result.

Ans. <TR><TD COLSPAN = 3> OpenOffice</TD></TR>

4. Write the HTML code to create the given table.

Ans. <TABLE BORDER=1>


<TR><TD COLSPAN = 3> Cricket Teams </TD></TR>
<TR> <TD>India</TD><TD>Sri Lanka </TD>
<TD>Afghanistan</TD>
</TR></TABLE>

5. What are forms in HTML? Give an example of its use.


Ans.
● An HTML form is a web page used to accept the user’s input.
● It is an interactive page that resembles a paper document containing text boxes, option
buttons, drop-down list, check boxes and so on.
● Forms can be used to enter online transaction details or to fill up an admission form for a
school.

b. What is a hyperlink? Explain the two types of hyperlink.


Ans.
● Hyperlinks are text or images, which, when clicked, opens another web page, image or
another file linked to it. It is created using an Anchor tag or <A> tag. ● There are two ways in
which a hyperlink can be created –
internal and external.
● An external hyperlink links to another file.
● An internal hyperlink is linked to a named location within the same file.

c. Explain the attributes of a form.


Ans.
● Action attribute – The action attribute of the form element defines the process to be
performed on the form when a form is submitted. If the action attribute value is blank, then
the form will be processed to the same page.
● Method attribute – The method attribute defines the HTTP method which the browser uses to
submit the form.

You might also like