0% found this document useful (0 votes)
30 views29 pages

Cha. 2 Introduction to HTML and Cha. 3 Advanced HTML

Chapter 2 introduces HTML with exercises including multiple choice questions, fill in the blanks, true or false statements, and theoretical questions. It covers various HTML tags, attributes, and their functionalities, such as creating lists, links, and formatting text. The chapter also discusses the structure of an HTML document and provides examples of HTML code.

Uploaded by

AYUSH AKSHAT
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)
30 views29 pages

Cha. 2 Introduction to HTML and Cha. 3 Advanced HTML

Chapter 2 introduces HTML with exercises including multiple choice questions, fill in the blanks, true or false statements, and theoretical questions. It covers various HTML tags, attributes, and their functionalities, such as creating lists, links, and formatting text. The chapter also discusses the structure of an HTML document and provides examples of HTML code.

Uploaded by

AYUSH AKSHAT
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/ 29

CHAPTER 2: INTRODUCTION TO HTML

Exercises
OBJECTIVE TYPE QUESTIONS
A. MULTIPLE CHOICE QUESTIONS (MCQs)

1. The <HR> tag inserts on a webpage.


a) A straight line
b) A circle
c) A border
d) None of these
Ans: a) A straight line
2. To display “bullets” against list items we use:
a) <OL>
b) <UL>
c) Both of them
d) None of them
Ans: b) <UL>
3. Which tag leaves a blank line?
a) <Hr>
b) <Br>
c) <Line>
d) <empty>
Ans: b) <Br>
4. To assign the background image for the document, background attribute is used with which of
the following tags?
a) <BODY>
b) <HTML>
c) <P>
d) None of these
Ans: a) <BODY>
5. The number of levels HTML supports to tag headings in a document is
a) 4
b) 6
c) 8
d) 10
Ans: b) 6
6. Which HTML tag will be used to scroll a text in webpage?
a) <marquee> … </marquee>
b) <scroll> … </scroll>
c) <round> … </round>
d) <go> … </go>
Ans: a) <marquee> … </marquee>
7. How to set a picture as a background in webpage?
a) <body background= “bgimage.gif”>
b) <body background image= “bgimage.gif”>
c) <background= “bgimage.gif”>
d) <background image= “bgimage.gif”>
Ans: a) <body background= “bgimage.gif”>
8. Which tag is used to insert line break in HTML code?
a) <pr>
b) <lb>
c) <br>
d) <break>
Ans: c) <br>
9. HTML document is saved using extension.
a) .htl
b) .html
c) .hml
d) .htnl
Ans: b).html
10. The software that can read and render HTML documents is
a) Server
b) Compiler
c) Interpreter
d) Browser
Ans: d) Browser
11. HTML document can contain
a) Attributes
b) Tags
c) Plain text
d) All of these
Ans: d) all of these
12. HTML tags are surrounded by brackets
a) Angle
b) Square
c) Round
d) Curly
Ans: a) Angle
13. Opening tag of HTML is called
a) Ending tag
b) Starting tag
c) Closed tag
d) Pair tags
Ans: b) Starting tag
14. To create HTML document, you require a
a) Webpage editing software
b) High powered computer
c) Just a notepad can be used
d) None of the above
Ans: c) Just a notepad can be used
15. Which HTML tags cause browsers to render text as italics?
a) <text style = ‘‘italics’’></text>
b) <ital.></ital.>
c) <i></i>
d) <b></b>
Ans: c) <i></i>
16. Which attribute is not valid for <body> tag?
a) background
b) color
c) vlink
d) leftmargin
Ans: b) color
17. Which of the following code displays a less than symbol while loaded in browser?
a) &lt;
b) &gt;
c) &copy;
d) &nbsp;
Ans: a) &lt;
18. What does &nbsp; stand for?
a) Non-blocked space
b) Non-breaking space
c) Non-baked space
d) Never-broken space
Ans: b) non-breaking space
19. Which of the following tag displays the content in the middle of browser horizontally?
a) <p alignment=”centered”>
b) <p text-align=”center”>
c) <p aligned=”center”>
d) <p align=”center”>
Ans: d) <p align=”center”>
20. Inserting <br> tag inside a paragraph
a) Adds a new paragraph
b) Breaks a paragraph into two
c) Adds a line break so that new line is started within same paragraph
d) Makes it an empty paragraph
Ans: c) Adds a line break so that new line is started within same paragraph
21. An ordered list is a list and an unordered list is a list.
a) bulleted & numbered
b) bulleted & tabular
c) tabular & numbered
d) numbered & bulleted
Ans: d) numbered & bulleted
22. Title tag is nested within the tag.
a) Body
b) Head
c) List
d) Table
Ans: b) Head
23. Which of the following is not a single tag?
a) <p> tag
b) <br> tag
c) <hr> tag
d) <img> tag
Ans: d) <p> tag
24. If a tag has its corresponding closing tag, such tags are called,
a) empty tag
b) container tags
c) self-closing
d) none of above
Ans: b) container tags
25. Which attribute is used to control the length of <hr> horizontal line?
a) length=value
b) width=value
c) height=value
d) none of above
Ans: b) width=value
26. A paragraph can be aligned left, right, center or justified using <p> tag with attribute
a) text-align
b) alignment
c) align
d) text-direction
Ans: c) align
27. Attribute for choosing type of font is
a) character
b) basefont
c) font
d) type
Ans: all option are wrong. According to the question answer is ‘face attrubute’
28. Which of the following is correct to change the text color to red?
a) <BODY Bgcolor = red>
b) <BODY text = red>
c) <BODY color = red
d) none of the above
Ans: b) <BODY text=red>
29. In HTML, each parameter in RGB (red, green, blue) defines intensity of color between?
a) 0-90
b) 0-255
c) 0-65536
d) 0-infinity
Ans: b) 0-255
30. Choose the correct HTML tag for largest heading
a) <heading>
b) <H6>
c) <head>
d) <h1>
Ans: d) <h1>
31. Choose the correct syntax to create an e-mail link
a) <A href = "abc@xyz.com">
b) <A href = "mailto:abc@xyz.com">
c) <mail = "abc@xyz.com">
d) <A mail = "abc@xyz.com">
Ans: b) <A href = "mailto:abc@xyz.com">
32. To create a link, we must use attribute with <A> tag
a) name
b) link
c) tag
d) href
Ans: d) href
33. In Internal linking, the sections names are defined by attribute of <A> tag.
a) href
b) title
c) name
d) none of the above
Ans: c) name
34. Which attribute of <A> tag is used to open a link in a new window?
a) name
b) target
c) HREF
d) none of these
Ans: b) target
35. Which option of <A> tag is used to send e-mail from the browser?
a) Mailto
b) E-mail
c) Name
d) Href
Ans: a) Mailto
B. FILL IN THE BLANKS

1. HTML stands for Hyper Text Markup Language.


2. An Html document has two distinct parts Head and Body.
3. In HTML, the tags that have both an ON tag and an OFF tag are called container elements.
4. vlink is used to change the color of a visited link.
5. ul tag creates a bulleted list.
6. Background tag is used for inserting a background image.
7. For displaying colored text, font tag is used.
8. HR tag is used for horizontal line.
9. bgcolor attribute of the BODY tag is used to set the color of the background.
10. size attribute is used to define the thickness of horizontal rule.
C. STATE TRUE OR FALSE
1. <Caption> tag gives heading to a webpage. False
2. <Head> defines the HTML header and does not affect the appearance of document. True
3. Line breaks are given through <BR>. True
4. Color attribute is used with <P> tag. False
5. HTML is case sensitive. False
6. There must be one <body> tag in each webpage. True
7. <I> tag displays text in bold. False
8. There are 9 heading levels in HTML. False
9. HTML is a programming language. False
10. There must be only one <HTML> tag in Html. True

THEORETICAL QUESTIONS
1. Write the HTML code to display a horizontal line of red color.
Ans:
<HTML>
<HEAD>
<TITLE>
RED HORIZONTAL LINE
</TITLE>
<HEAD>

<BODY>
<BR><H1> DISPLAY RED HORIZONTAL LINE</H1> <BR><BR>

<HR COLOR="red">

</BODY>
</HTML>
2. Write the HTML code to create a paragraph whose text color is Red.
Ans:
<HTML>
<HEAD><TITLE>A paragraph whose text color is Red </TITLE><HEAD>

<BODY>
<font color=”red”>
<p style="color: red";> Paragraph text in red color </p>.
</font>
</BODY>
</HTML

3. Differentiate between <FONT SIZE > and <BASEFONT SIZE> tag.


Ans: The main difference between base font and font tag is that base font sets the font to be used
throughout the page whereas the font tag can be used to change the font for a particular section of
the page.

4. How can different tags be combined in HTML? What is its use?


Ans: Tags in HTML can be combined in order to get the desired results of both the tags on an
element such as text. For example, we can bold text using the bold (b) tag and we can also italicize
text using the italic (i) tag. To bold and italic text together, use the i tag inside the b tag or vice
versa.

5. How many types of lists are available in HTML? Name them.


Ans: There are three types of lists:
i. Ordered list
ii. Unordered list
iii. Definition list
6. Which tag is used to give blank space in HTML?
Ans: &nbsp tag is used for displaying one space between the text.

7. Name the attribute used with <A> tag to specify the URL of link.
Ans: The href attribute is used to define hyperlink in the <a> element.

8. What is the method of using comment line in HTML?


Ans: Comment is a statement which is not displayed on browser window. Comment makes it easy
to understand which code is written for what purpose. Comment may be a single line or it may be
a multiline. Comment tags <! -- and -->

9. Differentiate between empty and container elements in HTML.


Ans:
Empty tags Container tags
Empty tags do not require any closing tags. Container tags are followed by their
corresponding closing tags.
The name of the closing tag is same as that
of the opening tag, but the name is
preceded by a backslash (/).
Example: Example: <html>, <head>, <title>,
<HR> (tag that creates a horizontal rule) <tr> (tag that creates a row in table)
<BR> (tag that creates a line break) <ol> (tag that creates an ordered list)

10. Identify the errors and write the correct HTML statements:
a. <BODY BGCOLOUR= “Red”>
b. <FONT TYPE = “Arial”>
Ans:
a. <body bgcolor= “Red”>
b. <font face = “Arial”>
11. Write the html code to make background appear blue, text yellow, recently visited link green
and selected link as purple.
Ans: <BODY BGCOLOR = #0000FF TEXT = #FFFF00 LINK = 00ffff VLINK = 00FF00 ALINK = #800080>

In place of colour codes, colour names also can be written.


12. Differentiate between absolute and relative URLs.
Ans: The main difference between an absolute URL and a relative URL is that, an absolute URL is a
complete address containing protocol, domain, and path while a relative URL points to a file
relative to the current directory or file. Using relative URLs are much easier since they are shorter
and more portable. But relative URLs can only be used to refer to links that reside on the same
server as the page that refers them.

13. Write down the correct syntax for creating a link on a webpage.
Ans:
<A HREF = " https://www.google.com/ "> is the correct syntax for creating a link to webpage.
Example
<A HREF = " https://www.google.com/ "> Open Google search engine </A>
Explanation:
 <a> tag refers to hyperlink.
 It is used to define a link among webpages.
 <a> has an attribute named as href attribute.
 The webpage which is to be linked is mentioned in href attribute.
 By default, an unvisited link is visible underlined and blue.
14. Write the HTML code to set page title as “My First Webpage”.
Ans:
<HTML>
<HEAD>
<TITLE>My First Webpage</TITLE>
</HEAD>
</HTML>

15. Write the HTML code to set image favorite.gif on your webpage.
Ans: <img src="C:\Users\Desktop\favorite.gif">

16. Name the attributes of <A> tag used to create an internal link in a webpage.
Ans: Internal link is linked within the same webpage. In this type of linking, a particular section is
defined by an <a> tag, used as the anchor point name, and is referred to an internal link into the
same page
<HTML>
<HEAD>
<TITLE>Internal Linking</TITLE>
</HEAD>
<BODY>
<A NAME="first"> <B>Fossil Fuels</B></A>
<P>The growing demand for energy was largely met by the fossil fuels – coal and petroleum. Our
technologies were also developed for using these energy sources. But these fuels were formed
over millions of years ago and there are only limited reserves. The fossil fuels are non-renewable
sources of energy.</P><BR><BR><BR><BR>
<H2><B>Hydro Power Plants</B></H2>
<P>Hydro power plants convert the potential energy of falling water into electricity </P>
<A HREF="#first"> go to Fossil Fuels</A>
</BODY>
</HTML>

17. Write the HTML code to display text in a particular font type. For example
Font size=5
Font face=Arial
Font color=green
Ans: <font face = "Arial" color=green size=5>
18. Write the html code to display usage of comment.
Ans:

19. Write the html code to display various bullet styles.


Ans:
<HTML>

<BODY BGCOLOR="pink">
<H2>Uses of fossil fuel</H2>

<FONT COLOR="green" size =5>

<UL>
<LI TYPE="square">In cooking: LPG (Petroleum product), Coal </LI>
<LI TYPE="disc">In vehicles: Petrol, diesels </LI>
<LI TYPE="circle">To produce electricity in Thermal power plant </LI>
</UL>
</FONT>
</BODY>
</HTML>
20. What is the extension of html code file?
Ans: The extension of html code file is .html.
21. Write down the different types of alignment attributes used in paragraphs.
Ans:
Align attribute is used to change the alignment of the paragraph.
<P ALIGN= “left”> used for left alignment of paragraph
<P ALIGN= “right”> used for right alignment of paragraph
<P ALIGN= “justify”> to justify a paragraph
22. Explain the structure of HTML file.
Ans: The basic structure of html file is:
<html>
<head>
<title>

</title>
</head>

<body>

</body>
</html>
23. A website on the topic ‘Green House Effect’ is to be set, which tags are used to give title and
headings of webpage.
Ans:
A <title> tag is an HTML element that specifies the title of a webpage. Heading is a text that is
separated from the other contents on a webpage. There are six heading levels in HTML, i.e., <H1>
to <H6>. As we increase through the heading levels, i.e., from H1 to H6, the size of the heading will
be decreased.
<HTML>
<HEAD>
<TITLE>Green House Effect</TITLE>
</HEAD>
<BODY BGCOLOR="yellow">
<H1>Heading 1</H1>
<H2>Heading 2</H2>
<H3>Heading 3</H3>
<H4>Heading 4</H4>
</BODY>
</HTML>

24. Name the two attributes of the body tag used to specify backgrounds.
Ans: Two attributes of body tag are:
• bgcolor - specifies the background color of a document.
• background- sets an image as background of the webpage.
<BODY BGCOLOR ="yellow"> or <BODY background ="image.jpg">

25. What do you understand by VLINK?


Ans:
Vlink: It is used to set color for visited link
<BODY TEXT = 00ff00 ” LINK = 0000ff VLINK = ff0000>
APPLICATION BASED QUESTIONS
1. Consider the following webpage and answer the following questions:

a. Which tag is used to display a horizontal line?


Ans: <hr>
b. Write the HTML code used for displaying heading color.
Ans: <font color=”blue”> <H1> working of Thermal Power Plant </h1> </font>
c. Write the HTML code for paragraph alignment.
Ans: <P ALIGN="left">
d. Write the HTML code for setting text color.
Ans: <BODY bgcolor = #00cccc text=#009922>
e. How many heading levels are used?
Ans: Three

COMPLETE CODE
<HTML>
<HEAD> <TITLE> Green House Effect< /TITLE> </HEAD>

<BODY bgcolor = #00cccc text=#009922>


<Font face="arial">
<H1 ALIGN="center"> <b> Working of Thermal Power Plant</b> </H1>
</Font>

<hr width=100% color="gray" size="3">

<Font color = #990000">


<h2>Thermal Power Plant is a plant in which electricity is produced from fossil fuel mainly coal. </h2>
</Font> <br><br>

<p>
Large amount of fossil fuels is burnt every day in power station to heat up water to produce stem
which further runs the turbine to generate electricity. </p>
<br><br>

<p>
The transmission of electricity is more efficient than transporting coal or petroleum over the same
distance. Therefore, many thermal power plant is used since fuel is burnt to produce heat energy
which is converted into electrical energy. </p>

</BODY>
</HTML>

2. Consider the following webpage and answer the given questions.

a. Write the HTML code to display the first heading of the webpage.
Ans: <Font face="Arial" color:#0033cc > <H1 > <b> WindEnergy </b> </H1> </Font>
b. Write the HTML tag to display line in blue color.
Ans: <hr width=95% color="blue" size="2">
c. Write down the HTML code to display an ordered list as shown in page.
Ans:
<OL>
<LI> No Pollution </LI>
<LI> Renewable </LI>
<LI> No recurring cost </LI>
</OL>
d. Write the HTML code to display an unordered list as shown in page.
Ans:
<uL type ="disc">
<LI> high set up cost </LI>
<LI> Wind farms can be established at those places where windspeed is greater than 15 km/hr </LI>
<LI> Requires large area around 1 MW-2 hectare land </LI>
</UL>
e. Write the HTML code to change round bullet of unordered list to square bullet.
Ans: <uL type ="square">
f. Is there a nested list in given example?
Ans: Yes

3. Observe the given webpage and write HTML code to generate it.

Note the following points while generating the webpage.


 Title of page is “Energy from the Sea”
<HTML>
<Head>
<Title>“Energy from the Sea”
</Title>
</Head>
 Heading of the page is center aligned.
<H1 align=”center”> <b> <u> Energy from Sea </u></b> </H1>
 Background color code is #F5ECCE
<BODY bgcolor=#F5ECCE text= #1E8449>
 Font style for the page is Arial.
<Font face="Arial">
 Second and third heading of the page is Red in color.
 Both the heading must be underlined
<font color=ff0000>
<H2 > <u> Tidal Energy </u> </H2>
<H2 > <u> Wave Energy </u> </H2>
</font>

Complete Code
<HTML>
<Head>
<Title>Energy from the Sea
</Title>
</Head>

<BODY bgcolor=#F5ECCE text= #1E8449>

<Font face="Arial" color=”#0000ff”>


<H1 align=”center”> <b> <u> Energy from Sea </u></b> </H1>
</Font>

<font color=”#ff0000”>
<H2 > <u> Tidal Energy </u> </H2>
</font>

<p> Due to the gravitational pull of mainly the moon on the spinning earth, the level
of water in the sea rises and falls. This phenomenon is called high and low tides and the
difference in sea levels gives us tidal energy. Tidal energy is harnessed by constructing a
dam across opening to the sea. </p>

<hr width=100% color="blue" size="2" align ="Center">

<font color=”#ff0000”>
<H2 > <u> Wave Energy </u> </H2>
</font>

<p> The kinetic energy possessed by huge waves near the seashore can be trapped in a
similar manner to generate electricity. The waves are generated by strong winds blowing
across thesea. </p>

</Body>
</HTML>
CHAPTER 3: ADVANCED HTML
Exercises
OBJECTIVE TYPE QUESTIONS
A. MULTIPLE CHOICE QUESTIONS (MCQs)
1. Which tag is used to insert an image in a webpage?
a) <A>
b) <IMG>
c) <UL>
d) <DL>
Ans: b) <IMG>
2. To display “bullets” against list items we use:
a) <OL>
b) <UL>
c) Both of them
d) None of them
Ans: b) <UL>
3. Which of these tags belongs to <table> tag?
a) <thead><body><tr>
b) <table><head><tfoot>
c) <table><tr><td>
d) <table><tr><tt>
Ans: c) <table><tr><td>
4. Which one of the following is not an option for aligning data in a table?
a) Justify
b) Right
c) Left
d) Center
Ans: a) Justify
5. With which code you can make an image work as link?
a) <A href=“URL”>Text</A>
b) <A href= ABC.html><img src=graphic.gif>Click Here</A>
c) <A ref=mailto:<img src=graphic.gif>Click Here</A>
d) None of the above
Ans: b) <A href= ABC.html> <img src=graphic.gif> Click Here </A>
6. Which of these tags is/are used with <Table> tag?
a) <TR>
b) <TD>
c) <TH>
d) All of the above

Ans: d) All of the above


7. Which attribute(s) is/are used to merge rows?
a) Rowspan
b) Colspan
c) Both of them
d) None of the above
Ans: a) Rowspan
8. Which of the following is/are attributes of <TR> tag?
a) Text
b) Color
c) Align
d) All of the above
Ans: c) Align
9. A is a combination of row and column.
a) Cell
b) Record
c) Field
d) None of the above
Ans: a) Cell
10. Alt attribute is used to display an image in a web browser.
a) Yes
b) No
c) Can’t say
d) None of the above
Ans: a) Yes
11. Which of the following is true regarding the <caption> tag?
a) It defines a caption for the table.
b) It can specify only one caption per table.
c) It must be inserted immediately after <TABLE> tag.
d) All the above.
Ans: d) All the above
12. What are the two required attributes of HTML <IMG> tag?
a) SRC and ALT
b) ALT and MARK
c) CANVAS and SRC
d) CAPTION and SRC
Ans: a) SRC and ALT
13. 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
14. If we want an image to be the hyperlink, the correct syntax is:
a) <img src = image.gif><a href = try.html>click</a>
b) <a href = try.html><img src = image.gif>click</a>
c) <a href = image.gif><img src = try.html>click</a>
d) <img src = try.html>
Ans: b) <a href = try.html><img src = image.gif>click</a>

15. What is the cell padding in HTML?


a) It specifies the spacing between the cell content and its borders.
b) It specifies the spacing between the cell content and its headings.
c) It specifies the spacing between the cell content and its formatting.
d) It specifies the spacing between the cell content and its descriptions.
Ans: a) It specifies the spacing between the cell content and its borders.
16. Which attribute tells us how many rows a cell should span?
a) colspan = n
b) rowspan = n
c) Both (a) & (b)
d) None of the above
Ans: b) rowspan = n
17. Which of the following is the attribute of table?
a) SRC
b) LINK
c) CELLPADDING
d) BOLD
Ans: c) CELLPADDING
18. Which tag is used to add columns to tables?
a) <colspan>
b) <td>
c) <tr>
d) All of the above
Ans: b) <td>
19. <TD>…</TD> is used for
a) Table heading
b) Table record
c) Table row
d) None of the above
Ans: d) None of the above
20. Which tag tells where a link starts?
a) <l>
b) <star>
c) <a>
d) None of the above
Ans: c) <a>
21. What is the correct syntax in HTML for creating a link on a webpage?
a) <LINK SRC=’abc.html”>
b) <BODY LINK=”abc.html”>
c) <A SRC=”abc.html>
d) <A HREF= “abc.html”>
Ans: d) <A HREF= “abc.html”>
22. Choose the correct syntax to create an e-mail link:
a) <A href = "abc@xyz.com">
b) <A href = "mailto:abc@xyz.com">
c) <mail = "abc@xyz.com">
d) <A mail = "abc@xyz.com">
Ans: b) <A href = "mailto:abc@xyz.com">
23. How to set a picture as a background webpage?
a) <body background= “bgimage.gif”>
b) <body background image= “bgimage.gif”>
c) <background= “bgimage.gif”>
d) <background image= “bgimage.gif”>
Ans: a) <body background= “bgimage.gif”>
24. Choose the correct HTML tag to left-align the content of a cell.
a) <tdleft>
b) <td leftalign>
c) <valign= “left”>
d) <td align= “left”>
Ans: d) <td align= “left”>
25. Is it possible to insert a table within another table?
a) Yes, but there must be exactly 2 rows and 2 columns in first table.
b) Yes, table can be inserted into cell of another table.
c) Yes, but there must be no border in second table.
d) No, it’s not possible.
Ans: d) No, it’s not possible.
26. In order to add border to a table, border attribute is specified in which tag?
a) <TH>
b) <table>
c) <TD>
d) <TR>
Ans: b) <table>
27. rowspan=n can be added to only which tag?
a) <hr>
b) <table>
c) <td>
d) <tr>
Ans: c) <td>
28. The attribute adds space within each cell.
a) CELL SPACING
b) CELL PADDING
c) WIDTH
d) ALIGN
Ans: b) CELL PADDING
29. Which tag allows you to add a row in a table?
a) <td> and </td>
b) <cr> and </cr>
c) <th> and </th>
d) <tr> and </tr>
Ans: d) <tr> and </tr>
30. Which attribute of the <TABLE> tag is used to set an image in the background of a table?
a) BGCOLOR
b) BACKGROUND
c) FRAME
d) RULES
Ans: b) BACKGROUND
B. FILL IN THE BLANKS
1. <img> tag border attribute is used to give border to an image.
2. <TD> tag can only be present inside tr tag.
3. The default alignment of an image is left.
4. In HTML, while creating a table, we cannot use background attribute with ____ tag.
Ans: this question is wrong. We can use background attribute with either <table> or with <tr> or
with <td> to set an image as background of either for entire table or for a particular row or for a
particular cell respectively.
5. To increase space between two cells, cell spacing attribute should be used.
6. tr tag is used to create a table row.
7. A tag that requires an opening as well as a closing tag is called a container tag.
8. The tag to start a table is <table>.
9. Anchor tag is used to connect webpages.
10. A tag that requires an opening as well as a closing tag is called a container tag.
11. Colspan attribute is used to span two or more columns in a Table.
12. Rowspan is used to combine the cell vertically.
13. The intersection of row and column in a table is known as cell.
14. The href attribute of <A> tag is used to specify the URL of a link.
15. The <tfoot> tag is used to define footer of a table.

C. STATE TRUE OR FALSE


1. BORDER is an attribute of a <A> tag in HTML. False
2. The ROWSPAN attribute of a table is used to merge more than one cell row-wise. True
3. MAILTO tag is used to send e-mail. True
Ans: actually it not a tag.
4. Each cell of a table will be assigned with different colors. False
if the question is asked like’ Each cell of a table çan be assigned with different colors.
Then answer is ‘True’
5. CAPTION tag is used to align a Table in HTML. False
6. A hyperlink applies to text only. False
7. <th> tags always need to come at the start of a column. False
<th> tag can be used to make any cell bold by replacing <td> with <th>
8. The default alignment of an image is right. False
9. Alt attribute with <img> tag is used for alternate image. True
Actually it is to display a text as alternative to an image.
10. Cellpadding attribute is used with <td> tag. False
11. A table’s background color can be specified using backgroundcolor attribute. True
12. SRC attribute specifies an alternate text for an image, if the image cannot be displayed. False
13. It is possible to create link within same document. True
14. CELLPADDING is the space between the contents of the cell and cell border. True
15. <TD> tag is used to define data heading of a table. False

THEORETICAL QUESTIONS
1. Write the HTML code to display a table with border of 5px.
Ans:
<html>
<body>
<table border = '5'>
<tr> <td> l </td> </tr>
<tr> <td>2 </td> </tr>
</table>
</body>
</html>
2. Write the HTML code to display an image on the right side of page.
Ans:
<html>
<body>
<img src=”image.jpg” align=”right”>
</body>
</html>
3. Name the attributes of <img> tag which are used for specifying its dimensions in a webpage.
Ans: Width and height
4. Write the full forms of the following:
Ans:
i. <TD> = table definition
ii. HTML = hyper text markup language
iii. ALT = alternate text
iv. <TFOOT> = table foot

5. What is the difference between cellspacing and cellpadding attribute of a table?


Ans: Cellpadding basically defines the space present between a table cell's border and the content
present in it. Cellspacing basically defines the space present between individual adjacent cells.

6. Write the HTML code to insert an image on webpage named mypic.jpg located at c:\.
Ans:
<html>
<body>
<img src=”c:/mypic.jpg”>
</body>
</html>

7. Write the HTML code to give ‘Red’ as a background color to table.


Ans: <table bgcolor=”red”>

8. Write the HTML code to display the given table.

Ans:
<table>
<tr>
<th colspan=”4”> My Hobbies </th>
</tr>
<tr>
<td> Dancing </td>
<td> Reading </td>
<td> Swimming</td>
<td> Music</td>
</tr>

<tr>
<td colspan=”4”> Everyone has talent. </td>
</tr>
</table>
9. Write the HTML code to display the given table.

Ans:
<table>
<tr>
<th> A </th>
<th> B </th>
<th> C </th>
</tr>

<tr>
<td rowspan=”2”> D </td>
<td> E </td>
<td rowspan=”2”> F </td>
</tr>

<tr>
<td> G </td>
</tr>

<tr>
<td colspan=”3”> I< /td>
</tr>

</table>
10. Write an HTML code to insert an image to a cell of table.
Ans:
<td>
<img src=”image.jpg”>
</td>
11. Differentiate between cellspacing and cellpadding.
Ans: Cellpadding basically defines the space present between a table cell's border and the content
present in it. Cellspacing basically defines the space present between individual adjacent cells.

12. Write the HTML code to create an ‘image1.jpg’ as a hyperlink to file ‘Description.html’.
Ans: <a href=”description.html”> <img src=”image1.jpg”> </a>
13. Write down the different attributes of <IMG> tag.
Ans: Src and alt
14. How many alignments are available for aligning images in a webpage? Name them.
Ans: In HTML, five types of alignment are available to align an image, which are:
i. Top
ii. Middle
iii. Bottom
iv. Left
v. Right
15. Define <THEAD>, <TBODY> and <TFOOT> tags of a table.
Ans:
<thead> = The <thead> tag is used to group header content in an HTML table.
<tbody> = The <tbody> tag is used to group the body content in an HTML table
<tfoot> = The <tfoot> (short for table foot) element defines a table's footer. It is typically used to
group a set of table rows summarizing the columns of the table

16. Write a HTML code to create a table of 5 Columns and 3 Rows.


a. Header row have a ‘pink’ color while other two rows have ‘yellow’ color.
Ans: <table>
<tr>
<th bgcolor=”pink”>column1</th>
<th bgcolor=”pink”>column2</th>
<th bgcolor=”pink”>column3</th>
<th bgcolor=”pink”>column4</th>
<th bgcolor=”pink”>column5</th>
</tr>

<tr>
<td bgcolor=”yellow”>data1</td>
<td bgcolor=”yellow”>data2</td>
<td bgcolor=”yellow”>data3</td>
<td bgcolor=”yellow”>data4</td>
<td bgcolor=”yellow”>data5</td>
</tr>
<tr>
<td bgcolor=”yellow”>data6</td>
<td bgcolor=”yellow”>data7</td>
<td bgcolor=”yellow”>data8</td>
<td bgcolor=”yellow”>data9</td>
<td bgcolor=”yellow”>data10</td>
</tr>

</table>

17. Observe the following table and write the HTML code to generate it.

Ans:
<table>
<tr>
<th colspan=”2”> SUBJECT </th>
<th> STUDENT A </th>
<th> STUDENT B </th>
</tr>

<tr>
<td colspan=”2”> BIOLOGY </td>
<td> PRACTICAL </td>
<td> A+ </td>
<td> A </td>
</tr>

<tr>
<td> THEORY </td>
<td> A+ </td>
<td> A </td>
</tr>

<tr>
<td colspan=”2”> CHEMISTRY< /td>
<td> PRACTICAL </td>
<td> A+ </td>
<td> A </td>
</tr>

<tr>
<td> THEORY </td>
<td> B+ </td>
<td> B </td>
</tr>

<tr>
<td colspan=”2”> PHYSICS </td>
<td> PRACTICAL </td>
<td> C+ </td>
<td> B </td>
</tr>

<tr>
<td> THEORY </td>
<td> A+ </td>
<td> A </td>
</tr>

</table>

18. Write the HTML code to display an inline image named student.jpg located at c:\ in the
center of your webpage.
Ans:
<html>
<body>
<center>
<img src=”c:\student.jpg”>
</center>
</body>
</html>

19. hat happens when we click on a hyperlink on webpage?


Ans: When we click on a hyperlink in a webpage it provides a link that leads from one document to
another.

20. Identify which of the following is a tag or an attribute.


Ans:
i. table = tag
ii. align = attribute
iii. img = tag
iv. border = attribute
v. width = attribute

21. Name the attributes of <A>tag which are used for internal linking in a webpage.
Ans: <name> and <href> are attributes which are used for internal linking in a webpage.

22. Name the tags used to specify


i. table data
ii. table header
iii. table row.
Ans: (i) <td> (ii) <th> (iii) <tr>

23. Name the two common attributes of <IMG> and <TABLE> tag.
Ans: Height and width.

24. Name the various attributes of <TR> tag.


Ans: Align, bgcolor, background , valign.

25. Define ROWSPAN and COLSPAN attributes of table.


Ans: The rowspan and colspan are <td> tag attributes. These are used to specify the number of
rows or columns a cell should span. The rowspan attribute is for rows as well as the colspan
attribute is for columns. These attributes have numeric values, for example, colspan=3 will span
three columns.

APPLICATION BASED QUESTIONS


1. Observe the given webpage and write HTML code to generate it.
Note the following points while generating the webpage.

 Title of the page is “Missile Man”.


Ans: <title>Missile Man</title>

 Background color code is #F9F2DD.


Ans: <body bgcolor=”#F9F2DD”>

 Heading level is H1.


Ans: <h1>A.P.J. Abdul Kalam</h1>

 Font color of the heading is ‘Red’ and ‘Center’ aligned.


Ans: <font color=red> <h1 align=center” > A.P.J. Abdul Kalam </h1> </font>

 Image is right aligned.


Ans: <img src=”image.jpg” align=”right”>

 Border of image is 3 px.


Ans: <img src=”image.jpg” align=”right” border=”3”>

 Table background color is yellow.


Ans: <table bgcolor=”yellow”>

 There is hyperlink ‘His Awards and Achievements’ of file ‘description.html’ saved in drive d:\.
Ans: <a href=”d:\description.html> His Awards and Achievements </a>

2. Consider the following webpage and answer the given questions.


a. Write the HTML code to give title “TAJ MAHAL” to the webpage.
Ans: <h1> TAJ MAHAL </h1>
b. Write the HTML tag to set green as background color.
Ans: <body bgcolor=”green”>
c. Write down the HTML code to display image at the right side of the webpage with borderof
3 points.
Ans: <img src=”image.jpg” align=”right” border=”3”>
d. Write the HTML code to form a given table.
Ans:
<table border=”1” bordercolor=”red” bgcolor=”yellow”>

<tr>
<th align=center> Fast Facts </th>
</tr>

<tr>
<td> Years of construction: 1631 </td>
</tr>
<tr>

<td> Completed in 1653 </td>


</tr>

<tr>
<td> Time taken: 22 years </td>
</tr>

<tr>
<td> Built by: Shah Jahan </td>
</tr>

<tr>
<td> Dedicated to Mumtaz Mahal, wife of Shah Jahan </td>
</tr>

<tr>
<td> Cost of construction: 32 crore rupees </td>
</tr>
<tr>
<td> Number of workers: 20,000 </td>
</tr>
3. Observe the following table and write HTML code to generate it.

Code: <HTML>
<head> <title> table </title> </head>

<BODY>

<table border=”1” >

<tr>
<td rowspan=3 > A </td>
<td colspan=3 > B </td>
</tr>

<tr>
<td > C </td>
<td > D </td>
<td > E </td>
</tr>

<tr>
<td colspan=3> F </td>
</tr>
</body>

</HTML>

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy