Chapter 5: Information Representation Method-HTML-I Solutions
Chapter 5: Information Representation Method-HTML-I Solutions
Solutions
Summative Assessment 8. Among the following, which is the RGB color scheme
for the colour Red?
Multiple-Choice Questions (MCQs) a. 255, 0, 0 b. 0, 0, 255
1. The tags that need both starting and ending tags are c. 0, 255, 0 d. None of these
called: . Ans. a
a. Container tags b. Empty tags 9. Which is the first version of HTML?
c. Closing tags d. None of these a. HTML 1.0 b. HTML 5
Ans. a
c. HTML 2.0 d. HTML 3.0
2. tag is used to change the font size, Ans. a
style, and colour of the text. 10. Which HTML tag is used to insert title in an HTML
a. <BR> b. <HR> document?
c. <H1> d. <FONT> a. <TITLE> b. <HEAD>
Ans. d
c. <BODY> d. <HTML>
3. The hexadecimal RGB value of the black colour is Ans. a
.
11. Which types of tags are used in HTML?
a. #FFFFF b. #000000
a. Predefined tags
c. #0 d. None of these
Ans. b b. User-defined tags
c. Tags used only for linking
4. The language of the HTML document is defined
with the help of the attribute of the d. Language-specific tags
Ans. a
<HTML> tag.
a. L b. LANG 12. The FACE attribute of the <FONT> tag is used for
c. BODY d. None of these .
Ans. b a. Changing the font type of the text
b. Changing the font color of the text
5. attribute of the <BODY> tag is used
to insert an image as the background of a Web page. c. Changing the font size of the text
a. IMAGE b. BACKGROUND d. None of these
Ans. a
c. FORMAT d. None of these
Ans. b 13. Which tag is used for line break?
6. tag is used to centralize the text within a. <HR> b. <BR>
the segment. c. <P> d. <EM>
a. <CENTER> b. <H1> Ans. b
c. <TEXT> d. None of these 14. Which attribute is used with the <BODY> tag to
Ans. a apply the background colour to an HTML page?
7. The output of the 3<SUP>rd<SUP> code is a. BACKGROUND b. COLOR
. c. BGCOLOR d. BCOLOR
a. 3rd b. 3<SUP>rd<SUP> Ans. c
c. 3 d. None of these
Ans. a
15. Which HTML tag is used to underline the text? a. Typeface, space
a. <I> b. <B> b. Font type, size
c. <C> d. <U> c. Font size, alignment
Ans. d d. Space between the headings, alignment
16. HTML tags are placed between . Ans. a
a. Hard brackets b. Angular brackets 25. When you want to provide breaks in the text or want
c. Curly brackets d. None of these the text to appear as a new, separate line, you need
Ans. b to use the tag.
17. HTML tags can be written in . a. <BR> b. <P>
a. Capital letters c. <HR> d. <BODY>
Ans. a
b. Small letters
c. Both capital and small letters 26. A/an is a code that is put into the
HTML code of a Web page to hide the text in a Web
d. None of these
page.
Ans. c
a. ALIGN attribute b. Comment
18. Which value is used for white color?
c. Content d. None of these
a. #00FFFF b. #000000 Ans. b
c. #FFFFFF d. #FFFF00
27. Which among the following will create a bulleted
Ans. c
list?
19. Which is not a logical text style? a. Unordered b. Option
a. <DFN> b. <EM> c. Decorated d. Ordered
c. <I> d. <CITE> Ans. a
Ans. c
Very Short Answer Questions
20. Empty tags require:
a. Opening tag 28. How can you display the 2D or 3D horizontal rule in
b. Closing tag a Web page?
c. Both opening and closing tags Ans.
To display the 2D horizontal rule, you need to put the following
code in your HTML document:
d. None of these
<HR SIZE=30 NOSHADE>
Ans. a
21. Which HTML tag is used to insert a horizontal rule? 29. Mention the tags that are used to create a definition
a. <HR> b. <BR> list.
Ans. The <DL> tag is used to create a definition list. You can create
c. <P> d. <EM> items in the definition list with the <DT> tag and <DD> tag.
Ans. a
30. What are the different types of lists supported in
22. Which one is the correct syntax of the HTML tag? HTML?
a. <PARA>HTML</PARA> Ans. The following types of lists are supported in HTML:
b. <b>HTML<b> Ordered
Unordered
c. <P>HTML</P>
Definition
d. None of these
Ans. c 31. What is the full form of RGB?
Ans. The full form of RGB is Red Green Blue.
23. The <BASEFONT> tag is supported by .
a. Internet Explorer b. Mozilla 32. What does <H6> signify?
Ans. <H6> is the smallest of all HTML heading levels.
c. Opera d. All of these
Ans. a 33. What is the use of the SIZE attribute in the
<BASEFONT> tag?
24. The headings can be differentiated on the basis of
Ans. In HTML, the SIZE attribute of the <BASEFONT> tag is used to
their and . change the default size of the selected font.
34. Mention the tags that are used to create an Ans. The container tag refers to a tag that contains an opening as
well as a closing tag. Examples of container tags are <HTML></
unordered list.
HTML>, <HEAD></HEAD>, <TITLE></TITLE>, and
Ans. An unordered list uses <UL> tag and <LI> tag to display the list <BODY></BODY>. On the other hand, an empty tag refers to a
of items in the bulleted format. tag that contains only an opening tag, such as <BR> and <HR>.
Short Answer Questions 41. Explain the use of the <PRE> tag with the help of
an example.
35. What is the basic difference between <BR> and
Ans. The <PRE> tag in HTML defines the preformatted text. This
<P> tags? implies that this tag helps you not only display text in the Web
Ans. The main difference between the <BR> and <P> tags is that the browser in a fixed-width font but also display the text in the same
<BR> tag is used to insert a line break on the Web page; whereas, way as you have typed it in the code. The <PRE> tag displays the
the <P> tag is used to mark a block of text as a paragraph or text in the Web browser with all blank lines and tabs. The default
separate your text into different paragraphs. The <P> tag not text font that the <PRE> tag uses is the Courier font. You should
only allows you to represent the text in the paragraph format but use the <PRE> tag to maintain a text format, which includes line
also enables you to format the paragraph text. breaks and tabs.
36. Mention the difference between an attribute and a The following code shows the use of the <PRE> tag:
<HTML>
tag. <HEAD>
Ans. An attribute provides additional information about the HTML tag. <TITLE> WELCOME TO HTML </TITLE>
For example, to specify a background color for a Web page, you </HEAD>
need to use the BACKGROUND attribute with the <BODY> tag. On <BODY>
the other hand, in HTML, a tag is a command to instruct the Web <PRE>
browser how to display the content in a Web page. For example, This text is inside the PRE tag
the <HTML> tag tells the Web browser that the document, which and therefore
contains the <HTML> tag, is an HTML document. is displayed in a fixed-width
font, and it preserves
37. List the tag specifications of the HEAD tag. both spaces and
Ans. The <HEAD> tag specifications are defined as follows: line breaks
Type: Container element </PRE> This text
Function: Header information is not inside the PRE tag
and therefore will be displayed
Attributes: dir and lang
in a single line.
Contains: Title, style, etc. </BODY>
Used inside: <HTML> tag </HTML>
38. What is a Title bar and how is it helpful? The output of the above mentioned code is shown in
Ans. A Title bar is a horizontal bar placed on the top of an application Figure 1:
window. The Title bar displays the name of the application and
the currently opened document. On the right side of the Title bar,
there are buttons, which you can use to minimize the application
window in the form of a button on the Taskbar, maximize the size
of the application window to cover the entire screen area, and
close the application window.
Black #000000 42. List the different ways in which a paragraph can be
Blue #0000FF aligned.
Ans. In HTML, there are three types of alignments, which are:
Green #008000
Left
Red #FF0000
Right
Yellow #FFFF00 Center
</HEAD> <HEAD>
<BODY BACKGROUND=fish.jpg> <TITLE>
</BODY> </TITLE>
</HTML> </HEAD>
<BODY>
The output of the above mentioned code is shown in Figure 3: <FONT SIZE=5 COLOR=red FACE= Comic
Sans Ms>
<P ALIGN=left>
<H3>
HTML is markup language
</H3>
</P>
</FONT>
</BODY>
</HTML>
The output of the above mentioned code is shown in Figure 5:
10. Write an HTML code to apply the font size 20 to the An HTML document is a file in which you can write code of HTML.
HTML document contains HTML tags and their attributes and plain
text Delhi.
text that create the Web page.
Ans. The following code allows you to set the font size of the given </P>
text: <HTML> </BODY>
<HEAD> </HTML>
<TITLE>
</TITLE> The output of the above mentioned code is shown in Figure 13:
</HEAD>
<BODY>
<FONT SIZE=20>
Delhi
</FONT>
</BODY> Figure 13: Displaying the Given Text in a Paragraph
</HTML>
The output of the above mentioned code is shown in Figure 11: 13. Write an HTML code to display the text My First
Web Page as title.
Ans. The following code allows you to display the My First Web Page
as title:
<HTML>
<HEAD>
<TITLE>
Figure 11: Applying the Font Size 20 to the Given Text
My First Web Page
11. Write an HTML code to display a horizontal line of </TITLE>
</HEAD>
25% size in blue colour. <BODY>
Ans. The following code allows you to display a horizontal line of the </BODY>
specified color and size: </HTML>
<HTML>
<HEAD> The output of the above mentioned code is shown in Figure 14:
<TITLE>
</TITLE>
</HEAD>
<BODY>
<HR SIZE=25%>
</BODY>
</HTML>
The output of the above mentioned code is shown in Figure 12:
Figure 14: Displaying the Given Text as Title of the Web Page
The output of the above mentioned code is shown in Figure 15: 17. Write an HTML code to display the 3D horizontal
rules.
Ans. The following code allows you to display the 3D horizontal rules:
<HTML>
<HEAD>
<TITLE>
Figure 15: Displaying the Body Text in the Given Style </TITLE>
</HEAD>
15. Write an HTML code to display a paragraph in right <BODY>
alignment. <HR>
</BODY>
Ans. The following code allows you to display a paragraph in right
</HTML>
alignment:
<HTML> The output of the above mentioned code is shown in Figure 18:
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY>
<P ALIGN=right> Figure 18: Displaying the 3D Horizontal Rules
An HTML document is a file in which you can write code of HTML. 18. Write an HTML code to display the text HTML
HTML document contains HTML tags and their attributes and plain
text that create the webpage.
stands for HyperText Markup Language in the italic
</P> and underline text style.
</BODY> Ans. The following code allows you to display the given text in the italic
</HTML> and underline text style:
The output of the above mentioned code is shown in Figure 16: <HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY>
Figure 16: Displaying the Paragraph in Right Alignment <I>
<U>
16. Write an HTML code to display the text I am in 10th HTML stands for Hyper Text Markup Language
</U>
standard in blue color with heading level 4.
</I>
Ans. The following code allows you to display the given text in blue </BODY>
color with heading level 4: </HTML>
<HTML>
The output of the above mentioned code is shown in Figure 19:
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY TEXT=blue>
<H4> I am in 10th standard </H4>
</BODY>
</HTML>
The output of the above mentioned code is shown in Figure 17:
Figure 23: Display the Given Text at the Center of the Web Page
</BODY>
</HTML>
<HR> <H3>
<BR> HTML stands for Hyper Text Markup Language
<BR> </H3>
<BR> </B> </LI>
<HR> <LI><I>
<BR> <P ALIGN=right>
<BR> HTML stands for Hyper Text Markup Language
<BR> </P>
<HR> </I> </LI>
<BR> </UL>
<BR> </BODY>
<BR> </HTML>
<HR>
<BR> The output of the above mentioned code is shown in
<BR> Figure 29:
<BR>
</BODY>
</HTML>
<UL TYPE=circle> Ans. The following code allows you to create the output as shown in
<LI>Inkjet Printer</LI> the question:
<LI>Dot-matrix Printer</LI> <HTML>
<LI>Laser Printer</LI> <HEAD>
</UL> <TITLE>The Earth</TITLE>
<LI>Monitor</LI> </HEAD>
<LI>Speaker</LI> <BODY BACKGROUND=wallpaper.jpg>
</UL> <H2> The Earth</H2>
</BODY> <HR>
</HTML> <H5>Earth is one of the nine planets of Solar
System...<BR><BR>
36. What should be the output of the following HTML The Earth is the densest major body in the
code: solar system. </H5>
<HTML> </BODY>
<HEAD> <TITLE>comment</TITLE> </ </HTML>
HEAD>
<BODY> 38. Write an HTML code to view the following line on a
<!-- This is a Comment Tag --> Web page:
<!-- This is the source code for
definition tag --> The < and > are used to create an HTML tag.
<DL> Ans. The following code allows you to display the given line:
<DT>Planet</DT> <HTML>
<DD>Celestial body that revolves <HEAD>
around the star</DD> <TITLE>
<DT>Satellite</DT> </TITLE>
<DD>Celestial body that revolves </HEAD>
around the planet</DD> <BODY>
<DT>Star</DT> The < and > are used to create an HTML
<DD>A celestial body that has its tag.
own heat and light</DD> </BODY>
</DL> </HTML>
</BODY>
</HTML> 39. Write an HTML code to write the following text on a
Ans. The output of the above mentioned code is shown in Figure 30: Web page:
H2O is the formula for water.
Ans. The following code allows you to display the text as given in the
question:
<HTML>
<HEAD>
<TITLE>
Figure 30: Displaying the Output of the Given Code </TITLE>
37. Write an HTML code to view the following output: </HEAD>
<BODY>
H<SUB>2</SUB>O is the formula for water.
</BODY>
</HTML>