Q1. HTML is acronym for :
(a) High Text Marker Language
(b) Higher Text Markup Language
(c) Hyper Text Markup Language
(d) Hyper Transfer Makeup Language
Ans. (c) Hyper Text Markup Language
HTML is acronym for Hyper Text Markup Language.
Q2. Which of the following tags identifies the document as an HTML document?
(a) <HEAD>
(b) <HTML>
(c) <BODY>
(d) <P>
Ans. (b) <HTML>
<HTML> tag identifies the document as an HTML document. An HTML document begins with <HTML> and ends with </HTML>.
Q3. Which sequence of HTML tags is correct ?
(a) <html><head><title></title></head><body></body></html>
(b) <html><head><title><body></title></head></body></html>
(c) <html><head><title</head><body></body>></title></</html>
(d) <html><head><title><body></body></title></head></html>
Ans. (a) <html><head><title></title></head><body></body></html>
The correct document structure of an HTML document is <html><head><title></title></head><body></body></html>.
Q4. To define the basic font size, which of following tag is used ?
(a) SIZE
(b) BASEFONT
(c) FONT
(d) All of these
Ans. (b) BASEFONT
The <BASEFONT> tag lets us define the basic size for the font, which the browser uses for text with no defined font size.
Q5. We can create a numbered list using the ............... tag.
(a) <UL>
(b) <list>
(c) <OL>
(d) <DL>
Ans. (c) <OL>
We can create a numbered list using the <OL> tag.
Q6. In <OL> and <UL>, the style of bullet or number is defined by ................. .
(a) type attribute
(b) style attribute
(c) both (1) and (2)
(d) None of the above
Ans. (a) type attribute
In <OL> and <UL>, the style of bullet or number is defined by type attribute. For unordered list, the type attribute may have a value of either disc for a solid circle, circle for a hollow circle or square for a solid square.
For ordered list, the type attribute may have the value of 'A' for numbering with capital letters, 'a' for lowercase letters, 'I' for capital and 'i' for lowercase Roman numerals and '1' for common Arabic numerals.
Q7. Tag(s) required to create Description lists in HTML:
(a) <DL>
(b) <DT>
(c) <DD>
(d) All of the above
Ans. (d) All of the above
A definition list <DL> usually consists of an alternating definition term <DT> and a definition description <DD>.
Q8. Factors that affect how an HTML document looks on the monitor do not include:
(a) operating system
(b) window size
(c) color depth
(d) html tags
Ans. (a) operating system
Factors that affect how an HTML document looks on the monitor do not include operating system.
Q9. Which of these is NOT an attribute of the font tag ?
(a) color
(b) face
(c) type
(d) size
Ans. (c) type
type is not an attribute of <FONT> tag. face, size and color attributes of <FONT> tag set the font, size and colour of the text respectively.
Q10. Which attribute is NOT valid for the <body> tag ?
(a) background
(b) color
(c) vlink
(d) bgcolor
Ans. (b) color
color is not an attribute of <BODY> tag. background, vlink and bgcolor are the attributes of <BODY> tag which specify the background image of the document, the colour of visited link and the background colour of the document, respectively.
Q1. What do you understand by 'Tag' ?
Ans. A tag is a coded HTML command that indicates how a part of web page should be displayed. HTML tags are written inside angle brackets (< >). For example,
<H1>Main Heading</H1>
Q2. What is an attribute in HTML ?
Ans. An attribute is a special word used inside tag to specify additional information to tag such as color, alignment, etc. For example, 'bgcolor' attribute of <BODY> tag is used to set the background colour of an HTML document.
<BODY bgcolor = "white">
Q3. <TITLE> tag is used to define ............... .
Ans. <TITLE> tag is used to define title of the document.
Q4. Face attribute is used with ............... tag and used for ............... .
Ans. Face attribute is used with <FONT> tag and used for setting the font type of the text.
Q5. What is the use of 'size' in <BASEFONT> tag ?
Ans. The <BASEFONT> tag is used with its attribute "size", whose value determines the document's base font size. The size can have an absolute value from 1 to 7 (eg., size = 5) or a relative value by placing a plus or minus sign before the value (eg., size = +1).
Q6. List and define different types of paragraph alignments.
Ans. The different types of paragraph alignments are as follows:
- Left alignment — When the value of align attribute of <P> tag is 'left', the paragraph is aligned to the left margin of the page.
- Center alignment — When the value of align attribute of <P> tag is 'center', the paragraph is aligned to the center of the page.
- Right alignment — When the value of align attribute of <P> tag is 'right', the paragraph is aligned to the right margin of the page.
Q7. <P> tag has no closing tag. State True or False?
Ans. False
<P> is a container element. Thus, it requires a starting tag <P> and a closing tag </P>.
Q8. <KBD> tag is used to display tables. State True or False?
Ans. False
<KBD> tag is used to display text as user keyboard entry. It is typically displayed in a fixed width font.
Q9. Give the coding for giving the heading 'PACE Computer Education' of <H1> tag, font style as Comic Sans MS, text color as blue. Body text color as red, background as green, alignment as center, font style of body text as Brush script, size = 15. The text for body is as follows:
Education is the
ability to listen to almost
anything without
losing your temper
or your
self confidence.
And so is Democracy and Maturity too.
Ans.
<BODY BGCOLOR = "GREEN" TEXT = "RED">
<H1>
<FONT FACE = "COMIC SANS MS" COLOR = "BLUE">PACE Computer Education</FONT>
</H1>
<P ALIGN = "CENTER">
<FONT FACE = "BRUSH SCRIPT" SIZE = "15">
Education is the
ability to listen to almost
anything without
losing your temper
or your
self confidence.
And so is Democracy and Maturity too.
</FONT>
</P>
Q10. What is wrong in the following coding ?
<FONT name = "Arial",
type = "Bold" size = 3>
Ans. The <FONT> tag has three attributes :
- face — It defines the font type
- color — It sets the color of font
- size — It sets the size of font
Type attribute is not used with <FONT> tag. To make the text bold, we use the <B> or <STRONG> tag.
The correct code is as follows:<FONT face = "Arial" size = "3">
Q11. What is wrong in the following coding ?
<FONT color = #345678
Ans. All HTML tags are enclosed in angle brackets (< >). The values of attributes are given in double quotes (" ").
The correct code is as follows:<FONT color = "#345678">
Q12. What is wrong in the following coding ?
<P Font face = "Arial" color = "Blue">
Ans. The paragraph <P> tag and the font <FONT> tag should be written in separate angle brackets as both are different tags.
The correct code is as follows:
<P> <FONT face = "Arial" color = "Blue">
Q13. What is wrong in the following coding ?
<BASEFONT SIZE = 5>
<BODY> Text with New format
</BODY>
Ans. <BASEFONT> tag should be inside the <BODY> tag.
The correct code is as follows:<BODY>
<BASEFONT SIZE = 5>
Text with New format
</BODY>
Q14. Differentiate between container and empty elements.
Ans.
Q15. List and explain the different attributes of body tag.
Ans. The different attributes of body tag are as follows:
- alink — It specifies the colour of an active link in a document.
- background — It specifies a background image for the document.
- bgcolor — It specifies the background colour of a document.
- link — It specifies the colour of unvisited links in a document.
- text — It specifies the colour of the text in a document.
- vlink — It specifies the colour of visited links in a document.
- leftmargin — It specifies the left margin in a document.
- topmargin — It specifies the top margin in a document.
The attributes are used with <BODY> tag in the following way:
<BODY ALINK = "BLUE" VLINK = "YELLOW" BACKGROUND = "ANIMALS.JPG" BGCOLOR = "BLACK" TEXT = "WHITE" LEFTMARGIN = "60" TOPMARGIN = "80">
Q16. How can a 2D or 3D horizontal rule be displayed ?
Ans. The <HR> tag is used to produce horizontal line spread across the width of the browser window. By default, a 3D horizontal line is produced.
If we want to produce a 2D rule, we add "noshade" to <HR> tag.
For example:<HR> <!-- This tag produces a 3D horizontal rule -->
<HR noshade> <!-- This tag produces a 2D horizontal rule -->
Q17. How can different tags be combined in HTML ? What is its use ?
Ans. HTML allows us to combine various tags together so as to achieve the desired result and effect. Different tags are enclosed in one another to combine their effects.
For example, if we want our text to appear bold and underlined, we can use <B> and <U> tags together in the following manner:
<B><U> Bold and Underlined </U></B>
Q18. Write the HTML code for the following to appear one after the other:
Ans.
<H3>We are Proud to Present</H3>
<HR>
<H1>Orbit</H1>
<H2>The Geometric Juggler</H2>
<HR>
Output
Q19. Write a complete HTML Web page with the title "Foo Bar" and a heading at the top which reads "Happy Hour at the Foo Bar", followed by the words "Come on down!" in regular type.
Ans.
<HTML>
<HEAD>
<TITLE> Foo Bar </TITLE>
</HEAD>
<BODY>
<H1> Happy Hour at the Foo Bar </H1>
<P>Come on down!</P>
</BODY>
</HTML>
Output
Q20. Differentiate between ordered and unordered lists.
Ans.
15 videos|131 docs|18 tests
|
1. What is HTML and why is it important in web development? | ![]() |
2. What are the basic components of an HTML document? | ![]() |
3. How do HTML tags work and what are some commonly used tags? | ![]() |
4. What is the purpose of attributes in HTML tags? | ![]() |
5. How can I ensure my HTML code is valid and well-structured? | ![]() |