html samples
html samples
Question 1
The ............... contain elements which define how the information on a web page is formatted or displayed.
1. Editors
2. Tags
3. Attributes
4. 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.
1. <HEAD>
2. <BODY>
3. <HTML>
4. 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
1. Tag
2. Element
3. Attribute
4. None of these
Answer
Attribute
Reason — The attribute property provides additional information about an HTML element.
Question 4
1. Right
2. Left
3. Justify
4. 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?
1. <SPACE>
2. <PRE>
3. <SPC>
4. 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
1. <HR>
2. <LINE>
3. <LINE Direction="horizontal">
4. <TR>
Answer
<HR>
Reason — The <HR> tag adds a line horizontally on your web page.
Question 7
1. <ii>
2. <Italics>
3. <Italic>
4. <I>
Answer
<I>
Reason — The <I> tag is used to make the text italic.
Question 8
1. <BR>
2. <LB>
3. <Break>
4. <Newline>
Answer
<BR>
Reason — The <BR> tag is used for inserting a line break.
Question 9
1. Element
2. Tag
3. Attribute
4. None of these
Answer
Element
Reason — An HTML element consists of an ON tag, the content, and an OFF tag.
Question 10
1. end
2. /
3. \
4. <
Answer
Question 11
1. Red
2. Black
3. Green
4. Blue
Answer
Blue
Question 12
The entity which displays an '&' sign on the browser is ............... .
1. &
2. <&>
3. &
4. None of these
Answer
&
Reason — The entity which displays an '&' sign on the browser is &.
Question 13
Which entity displays the ">" (greater than) sign on the browser?
1. <& GT>
2. >
3. & GRT
4. None of these
Answer
>
Reason — The > entity displays the ">" (greater than) sign on the browser.
Question 14
1. <H1>
2. <H6>
3. <HEAD>
4. 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?
1. <BASEFONT>
2. <COLOR>
3. <FONT>
4. <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 ............... .
1. Disc
2. Square
3. Circle
4. None of these
Answer
Disc
Reason — The default value of Type attribute for an unordered list is disc.
Question 17
1. <BL>
2. <OL>
3. <UL>
4. None of these
Answer
<OL>
Reason — The <OL> tag is suitable for creating a numbered list.
Question 18
Answer
Question 19
1. Document To Definition
2. Dynamic To Definition
3. Document Type Definition
4. Direct Type Definition
Answer
1. <?-->
2. <?- --?>
3. <!-- and -->
4. </--->
Answer
Question 21
1. <OL type="A">
2. <OL type="A" start= "5" >
3. <OL type="E" >
4. <OL start="E" >
Answer
Question 22
1. Notepad
2. Wordpad
3. Both 1 and 2
4. None of these
Answer
Both 1 and 2
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
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
Answer
Question 11
Answer
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
Answer
Question 14
Answer
Question 1
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
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
Answer
True
Reason — A list can be defined as a ordered list, unordered list or as a definition list.
Question 5
False
Question 6
Answer
True
Reason — We can start the ordered list with a different number which we can specify using the start attribute.
Question 7
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
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.
Question 1
Answer
Question 2
Answer
Container elements
Question 3
Answer
Question 4
<HR>
Question 5
Which attribute of HTML tag specifies the language used within the document?
Answer
Lang attribute
Question 6
Question 7
Which tag is used to set Font Face, Size, Color, and other attributes for the whole HTML document?
Answer
<BASEFONT>
Question 8
Answer
Question 9
a. Text Editor
b. Web Browser
Answer
a. Notepad
b. Google Chrome
Question 1
Question 2
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 require both, an opening and a closing Empty elements require only an
tag. opening tag and not a closing tag.
Container elements affect the text appearing between their Empty elements just carry out the job
opening and a closing tag. 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
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
Answer
1. <FONT>
2. <BODY>
Answer
Question 8
1. HR
2. align
3. BR
4. Text
5. P
6. Noshade
Answer
1. HR — Tag
2. align — Attribute
3. BR — Tag
4. Text — Attribute
5. P — Tag
6. Noshade — Attribute
Question 9
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
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
Question 12
Identify error(s) in the following HTML code and write the correct code.
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'.
Question 1
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
Answer
For example, <P> tag, <HR> tag etc. For example, <B> tag, <I> tag etc.
Question 3
This tag is used for making the text bold. This tag is used to insert a line break.
E.g. E.g.
<b>This text is bold.</b> 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:
Character
Symbol
Entities
<
<
> >
& &
Question 5
Differentiate between Ordered and Unordered list with the help of an example.
Answer
S.
Ordered List Unordered List
No.
The ordered list is used to display the list of The unordered list is used when the items are not to be
1.
items in a specific order. displayed in any particular order.
2.
<OL> tag is used to create ordered list. <UL> tag is used to create unordered list.
E.g. E.g.
<OL> <UL>
<LI>Apple</LI> <LI>Apple</LI>
<LI>Mango</LI> <LI>Mango</LI>
<LI>Banana</LI> <LI>Banana</LI>
</OL> </UL>
3. Output Output
1. Apple Apple
2. Mango Mango
3. Banana Banana
Question 6
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:
1. Input Devices
o Keyboard
o Mouse
o Joystick
2. Output Devices
o Monitor
o Speaker
o 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:
<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
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.
Answer
Question 3
Find error(s) in the following HTML code segment. Rewrite the correct code and underline the corrections made.
Question 4
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>