Multiple Choice Questions
Question 1
The ............... contain elements which define how the information on a web page is formatted or displayed.
- Editors
- Tags
- Attributes
- None of these
Answer
Tags
Reason — The tags contain elements which define how the information on a web page is formatted or displayed.
Question 2
The ............... tag contains the content of your document which gets displayed on the web page of your browser window.
<HEAD>
<BODY>
<HTML>
- None of these
Answer
<BODY>
Reason — The <BODY>
tag contains the content of our document which gets displayed on the web page of our browser window.
Question 3
Which special property provides additional information about an HTML element?
- Tag
- Element
- Attribute
- None of these
Answer
Attribute
Reason — The attribute property provides additional information about an HTML element.
Question 4
The ALIGN attribute of <P>
tag cannot take ............... value.
- Right
- Left
- Justify
- None of these
Answer
None of these
Reason — The ALIGN attribute of <P>
tag can take right, left and justify as value.
Question 5
Which of the following tags helps in retaining the spacing of text or displaying the preformatted spaces on a webpage in an HTML document?
<SPACE>
<PRE>
<SPC>
- None of these
Answer
<PRE>
Reason — The <PRE>
tag helps in retaining the spacing of text or displaying the preformatted spaces on a webpage in an HTML document.
Question 6
Which tag adds a line horizontally on your web page?
<HR>
<LINE>
<LINE Direction="horizontal">
<TR>
Answer
<HR>
Reason — The <HR>
tag adds a line horizontally on your web page.
Question 7
Choose the correct HTML tag to make the text italic.
<ii>
<Italics>
<Italic>
<I>
Answer
<I>
Reason — The <I>
tag is used to make the text italic.
Question 8
What is the correct HTML tag for inserting a line break?
<BR>
<LB>
<Break>
<Newline>
Answer
<BR>
Reason — The <BR>
tag is used for inserting a line break.
Question 9
An HTML ............... consists of an ON tag, the content, and an OFF tag.
- Element
- Tag
- Attribute
- None of these
Answer
Element
Reason — An HTML element consists of an ON tag, the content, and an OFF tag.
Question 10
Which character is used with the OFF tag?
- end
- /
- \
- <
Answer
/
Reason — The / character is used with the OFF tag.
Question 11
The default colour of LINK attribute is ............... .
- Red
- Black
- Green
- Blue
Answer
Blue
Reason — The default colour of LINK attribute is blue.
Question 12
The entity which displays an '&' sign on the browser is ............... .
&
<&AMP>
&AMP
- None of these
Answer
&AMP
Reason — The entity which displays an '&' sign on the browser is &AMP
.
Question 13
Which entity displays the ">" (greater than) sign on the browser?
<& GT>
&GT
& GRT
- None of these
Answer
&GT
Reason — The &GT
entity displays the ">" (greater than) sign on the browser.
Question 14
The HTML tag for the largest heading is ............... .
<H1>
<H6>
<HEAD>
- None of these
Answer
<H1>
Reason — The HTML tag for the largest heading is <H1>
.
Question 15
Which tag is used to define the basic font size for the whole document?
<BASEFONT>
<COLOR>
<FONT>
<SIZE>
Answer
<BASEFONT>
Reason — The <BASEFONT>
tag is used to define the basic font size for the whole document.
Question 16
The default value of Type attribute for an unordered list is ............... .
- Disc
- Square
- Circle
- None of these
Answer
Disc
Reason — The default value of Type attribute for an unordered list is disc.
Question 17
Which of the following tags is suitable for creating a numbered list?
<BL>
<OL>
<UL>
- None of these
Answer
<OL>
Reason — The <OL>
tag is suitable for creating a numbered list.
Question 18
To display (X+Y)2, the correct HTML code is:
<SUB> (X+Y)2 </SUB>
X+Y<SUP> 2 </SUP>
(X+Y) <SUP> 2 </SUP>
<SUP> (X+Y) 2 </SUP>
Answer
(X+Y) <SUP> 2 </SUP>
Reason — To display (X+Y)2, the correct HTML code is (X+Y) <SUP> 2 </SUP>
.
Question 19
What is the full form of DTD?
- Document To Definition
- Dynamic To Definition
- Document Type Definition
- Direct Type Definition
Answer
Document Type Definition
Reason — The full form of DTD is Document Type Definition.
Question 20
Anything written between ............... is taken as a comment.
<?-->
<?- --?>
<!-- and -->
</--->
Answer
<!-- and -->
Reason — Anything written between <!-- and -->
is taken as a comment.
Question 21
To start a list with alphabet 'E', which line should be used?
<OL type="A">
<OL type="A" start= "5" >
<OL type="E" >
<OL start="E" >
Answer
<OL type="A" start= "5" >
Reason — To start a list with alphabet 'E', we write the following code:
<OL type="A" start= "5" >
Question 22
Which of the following is a text editor?
- Notepad
- Wordpad
- Both 1 and 2
- None of these
Answer
Both 1 and 2
Reason — Notepad and Wordpad both are text editors.
Fill in the Blanks
Question 1
The ............... section contains the content to be displayed on the web page.
Answer
The <BODY>
section contains the content to be displayed on the web page.
Question 2
The ............... editor provides various tools and graphical interface where the web pages are designed.
Answer
The WYSIWYG editor provides various tools and graphical interface where the web pages are designed.
Question 3
............... and ............... are attributes of the <HR>
tag.
Answer
Size and Width are attributes of the <HR>
tag.
Question 4
The colour of the text in the HTML document can be changed using the ............... attribute of the Font tag.
Answer
The colour of the text in the HTML document can be changed using the Color attribute of the Font tag.
Question 5
The FACE attribute of the ............... tag is used to change the typeface or the name of the font.
Answer
The FACE attribute of the <FONT>
tag is used to change the typeface or the name of the font.
Question 6
The ............... attribute of Body tag defines the colour of the visited links in a document.
Answer
The <VLINK>
attribute of Body tag defines the colour of the visited links in a document.
Question 7
The ............... attribute of Body tag changes the colour of the Active link.
Answer
The <ALINK>
attribute of Body tag changes the colour of the Active link.
Question 8
The three values that can be defined with ............... tag are disc, square, and circle.
Answer
The three values that can be defined with <UL>
tag are disc, square, and circle.
Question 9
To specify the start value of the first item from which an ordered list should start, the ............... attribute is used.
Answer
To specify the start value of the first item from which an ordered list should start, the Start attribute is used.
Question 10
A list created within a list is called ............... list.
Answer
A list created within a list is called nested list.
Question 11
The default colour of a hyperlink on a web page is ............... .
Answer
The default colour of a hyperlink on a web page is blue.
Question 12
The ............... tag is used to create subscripts and ............... tag is used to create superscripts on a web page.
Answer
The <SUB>
tag is used to create subscripts and <SUP>
tag is used to create superscripts on a web page.
Question 13
The ............... attribute is used to define the thickness of horizontal rule.
Answer
The Size attribute is used to define the thickness of horizontal rule.
Question 14
The ............... tag is used to insert line break on a web page.
Answer
The <BR>
tag is used to insert line break on a web page.
State True or False
Question 1
The title of a document can contain maximum 64 characters.
Answer
True
Reason — The title should be short and include only upto 64 characters.
Question 2
The Heading levels are part of the <HEAD>
tag.
Answer
False
Reason — The Heading levels are part of the <BODY>
tag.
Question 3
The Vlink tag defines the colour of the link after it has been visited.
Answer
True
Reason — The Vlink attribute defines the colour of the link after it has been visited.
Question 4
A list can be defined in different styles.
Answer
True
Reason — A list can be defined as a ordered list, unordered list or as a definition list.
Question 5
The default value for <OL>
is a filled circle.
Answer
False
Reason — The default value for <UL>
is a filled circle or disc.
Question 6
You can start the ordered list with a different number.
Answer
True
Reason — We can start the ordered list with a different number which we can specify using the start attribute.
Question 7
The colour of the hyperlinks in an HTML document cannot be changed.
Answer
False
Reason — The Link, Alink and Vlink attributes of the body tag control the colours of the hyperlinks.
Question 8
There must be only one <title>
tag in an HTML document.
Answer
True
Reason — There must be only one <title>
tag in an HTML document and it is defined within the <HEAD>
tag.
Question 9
Unordered list type creates a bulleted list.
Answer
True
Reason — Unordered list type creates a bulleted list with bullets like disc, circle or square.
Question 10
Physical structure refers to different parts of a document, i.e., how a document is built.
Answer
True
Reason — Physical structure refers to the arrangement and organization of different parts of the document, including elements like headings, paragraphs, lists, tables, images, and more.
Answer in One Word or a Sentence
Question 1
What does W3C stand for?
Answer
World Wide Web Consortium
Question 2
Which elements have both starting and ending tags?
Answer
Container elements
Question 3
How many heading levels can be defined in HTML?
Answer
Six heading levels starting from <H1>
to <H6>
.
Question 4
Write the tag which is used as a separator between blocks of text.
Answer
<HR>
Question 5
Which attribute of HTML tag specifies the language used within the document?
Answer
Lang attribute
Question 6
What is the utility of <P>
tag?
Answer
Marks a block of text as a paragraph
Question 7
Which tag is used to set Font Face, Size, Color, and other attributes for the whole HTML document?
Answer
<BASEFONT>
Question 8
What type of lists are supported by HTML?
Answer
Unordered, Ordered and Definition
Question 9
Name any one software for each of the following categories:
a. Text Editor
b. Web Browser
Answer
a. Notepad
b. Google Chrome
Short Answer Type Questions
Question 1
Define the <BODY>
tag in HTML.
Answer
The <BODY>
tag is the largest part of the HTML document. It contains the content that appears on a web page when viewed in a browser. Within the <BODY>
tag, various formatting elements can be incorporated, such as images, headings, lists, and hypertext links to enhance the appearance of a web page.
Question 2
Define the term Hyperlink.
Answer
Hyperlink is a highlighted text segment or image that connects to other pages on the web.
Question 3
Differentiate between Container and Empty elements in HTML. Give any two examples of HTML tags from each category.
Answer
Container elements | Empty elements |
---|---|
Container elements require both, an opening and a closing tag. | Empty elements require only an opening tag and not a closing tag. |
Container elements affect the text appearing between their opening and a closing tag. | Empty elements just carry out the job assigned to them. |
For example, <TITLE>…</TITLE> , <FONT>…</FONT> etc. | For example, <BR> , <HR> etc. |
Question 4
Which attribute allows you to change the style of numbers in an ordered list?
Answer
'Type' attribute.
Question 5
What is an attribute in HTML?
Answer
An attribute is a property that provides additional information about an HTML element. It enhances the functionality of a tag and is always specified inside the opening tag.
Question 6
Which heading element gives the most prominent heading?
Answer
<H1> tag gives the most prominent heading.
Question 7
Write names of two attributes each for the following tags:
<FONT>
<BODY>
Answer
- Two attributes of
<FONT>
tag are Face and Size. - Two attributes of
<BODY>
tag are Bgcolor and Background.
Question 8
Identify which of the following is a tag or an attribute:
- HR
- align
- BR
- Text
- P
- Noshade
Answer
- HR — Tag
- align — Attribute
- BR — Tag
- Text — Attribute
- P — Tag
- Noshade — Attribute
Question 9
Write an HTML code to create the following ordered list.
C. Apples
D. Oranges
E. Grapes
Answer
<HTML>
<BODY>
<OL TYPE = "A" START = "3">
<LI>Apples</LI>
<LI>Oranges</LI>
<LI>Grapes</LI>
</OL>
</BODY>
</HTML>
Question 10
Write an HTML code to create the following bulleted list.
- MS Word
- MS Excel
- MS PowerPoint
- MS Access
Answer
<HTML>
<BODY>
<UL TYPE = "CIRCLE">
<LI>MS Word</LI>
<LI>MS Excel</LI>
<LI>MS PowerPoint</LI>
<LI>MS Access</LI>
</UL>
</BODY>
</HTML>
Question 11
Find the errors in the following HTML code and write the correct code.
<UL Style: Square> <LI> Water Bottles <LI> Lunch Box <LI> Handkerchief </OL>
Answer
The errors in the given code are as follows:
- The name of the attribute should be 'Type' and not 'Style'.
- The attribute is followed by an '=' symbol and not a ':' symbol.
<LI>
tags should be closed with</LI>
- The closing tag should be
</UL>
instead of</OL>
.
The correct code is as follows:
<UL Type= "Square">
<LI>Water Bottles</LI>
<LI>Lunch Box</LI>
<LI>Handkerchief</LI>
</UL>
Question 12
Identify error(s) in the following HTML code and write the correct code.
<OL Type= "a" Start= "d">
Answer
The error in the given code is that the value of start attribute should be numeric. Thus, for the list to start with 'd', the value of start attribute must be set to '4'.
The correct code is as follows:
<OL Type= "a" Start= "4">
Long Answer Type Questions
Question 1
Write a short note on web browser.
Answer
A web browser is essential software used for accessing websites and serves as an interface between users and the World Wide Web. Web browsers come in various forms, including those with graphical user interfaces like Internet Explorer, Mozilla Firefox, Google Chrome, Opera, as well as text-based browsers such as Lynx.
They are typically installed on individual computers, enabling users to effortlessly explore files, folders, and websites through hyperlinks. Multiple tabs and windows within the same browser can be opened simultaneously, enhancing user experience.
Web browsers offer an array of features and functionalities, including the ability to download content, save bookmarks for easy access, and manage passwords securely. They also provide tools like spell-checking, integrated search engine toolbars, tabbed browsing for efficient multitasking, ad-blocking features, accessibility through HTML access keys, and pop-up blocking to enhance browsing safety and convenience.
Question 2
Differentiate between Block-level elements and Text-level elements.
Answer
Block-level elements | Text-level elements |
---|---|
Block level elements take up the full width available and by default, begin on a new line. | Text level elements are used to markup the bits of text, including changing the text appearance or creating hyperlinks. They do not start on a new line and only take up as much width as necessary. |
For example, <P> tag, <HR> tag etc. | For example, <B> tag, <I> tag etc. |
Question 3
What is the difference between <B>
and <BR>
tags?
Answer
<B> tag | <BR> tag |
---|---|
This tag is used for making the text bold. | This tag is used to insert a line break. |
It is a container element. | It is an empty element. |
E.g.<b>This text is bold.</b> | E.g.This is some text <br> on a new line. |
Question 4
How can we display <, > and & symbols on a web page?
Answer
We can display the given symbols on a web page using the following character entities:
Symbol | Character Entities |
---|---|
< | &lt |
> | &gt |
& | &amp |
Question 5
Differentiate between Ordered and Unordered list with the help of an example.
Answer
Difference between Ordered and Unordered list:
S. No. | Ordered List | Unordered List |
---|---|---|
1. | The ordered list is used to display the list of items in a specific order. | The unordered list is used when the items are not to be displayed in any particular order. |
2. | <OL> tag is used to create ordered list. | <UL> tag is used to create unordered list. |
3. | E.g. <OL> <LI>Apple</LI> <LI>Mango</LI> <LI>Banana</LI> </OL> Output
| E.g. <UL> <LI>Apple</LI> <LI>Mango</LI> <LI>Banana</LI> </UL> Output
|
Question 6
What do you mean by nesting of list?
Answer
A list created within a list is called a Nested list. Ordered and Unordered list can be nested within each other to form a multilevel list. To create a nested list, we add a new list within a list. Consider the given example,
<OL>
<LI> Input Devices
<UL>
<LI> Keyboard </LI>
<LI> Mouse </LI>
<LI> Joystick </LI>
</UL>
<LI> Output Devices
<UL>
<LI> Monitor </LI>
<LI> Speaker </LI>
<LI> Printer </LI>
</UL>
</OL>
The nested list will be displayed as follows:
- Input Devices
- Keyboard
- Mouse
- Joystick
- Output Devices
- Monitor
- Speaker
- Printer
Question 7
What is the function of Definition List? Explain its structure with the help of an example.
Answer
Definition lists are used to outline the multiple terms and their descriptions one after another, as in a glossary and other name or value lists. It starts and ends with <DL>
and </DL>
tag respectively. The <DL>
tag is used in conjunction with <DT>
(Definition Term) and <DD>
(Definition Description) tags where:
<DT>
helps in defining the terms or names.<DD>
helps in describing each term or name.
Consider the following example,
<DL>
<DT>DNA</DT>
<DD>DNA stands for Deoxyribonucleic acid. It is the hereditary material in humans and almost all other organisms.</DD>
<DT>RNA</DT>
<DD>RNA stands for Ribonucleic acid. It acts as a messenger between DNA and the protein synthesis complexes known as ribosomes.</DD>
</DL>
The given HTML code is displayed in the following way:
- DNA
- DNA stands for Deoxyribonucleic acid. It is the hereditary material in humans and almost all other organisms.
- RNA
- RNA stands for Ribonucleic acid. It acts as a messenger between DNA and the protein synthesis complexes known as ribosomes.
Question 8
Discuss the use of <UL>
and <LI>
tags with suitable examples of each.
Answer
The <UL>
tag is used to define an unordered list. It indents each item in the list and adds a bullet against each of them. The <LI>
tag is used to display the listed items in an unordered or ordered list.
Consider the following example,
<HTML>
<BODY>
FRUITS
<UL>
<LI>Mango</LI>
<LI>Apple</LI>
<LI>Guava</LI>
<LI>Banana</LI>
</UL>
</BODY>
</HTML>
The list is displayed as follows:
FRUITS
- Mango
- Apple
- Guava
- Banana
Application Based Questions
Question 1
Mihir wants to know the name of any two text editors that can be used to write the code for an HTML webpage. Can you provide him with the names?
Answer
The two text editors that can be used to write the code for an HTML webpage are Notepad and Wordpad.
Question 2
Write the HTML code for the following in the space provided.
- A normal sized heading with the text, "LOYOLA HIGH SCHOOL."
- The largest size heading, "PETER PAN"
- A normal sized heading, "A MUSICAL"
- A horizontal line across the page
Answer
a. <H3> LOYOLA HIGH SCHOOL. </H3>
b. <H1> PETER PAN </H1>
c. <H3> A MUSICAL </H3>
d. <HR>
Question 3
Find error(s) in the following HTML code segment. Rewrite the correct code and underline the corrections made.
<UL STYLE: square>
<LI> Water Bottles
<LI> Lunch box
<LI> Handkerchief
</OL>
Answer
The errors in the given code are as follows:
- The name of the attribute should be 'Type' and not 'Style'.
- The attribute is followed by an '=' symbol and not a ':' symbol.
<LI>
tags should be closed with</LI>
- The closing tag should be
</UL>
instead of</OL>
.
The correct code is as follows:
<UL Type= "Square">
<LI>Water Bottles</LI>
<LI>Lunch Box</LI>
<LI>Handkerchief</LI>
</UL>
Question 4
6CO2 + 6H2O → C6H12O6 + 6O2
To display the above given chemical expression on a web page, the following HTML code was written:
6CO<sup>2</sup> + 6H<sup>2</sup>O →
C<sup>6</sup>H<sup>12</sup>O<sup>6</sup> + 6O<sup>2</sup>
But it's not displaying the expression in desired format. Identify the fault(s) and suggest the required correction(s).
Answer
<SUB>
tag is used to write a text as a subscript and <SUP>
tag is used to write a text as a superscript. The given chemical expression should be written using <SUB>
tag instead of the <SUP>
tag.
Thus, the given equation can be written correctly by writing the given HTML code:
6CO<SUB>2</SUB> + 6H<SUB>2</SUB>O →
C<SUB>6</SUB>H<SUB>12</SUB>O<SUB>6</SUB> + 6O<SUB>2</SUB>