This set of HTML Multiple Choice Questions & Answers (MCQs) focuses on “Fonts in HTML”.
1. How many standard color names does HTML supports?
a) 120
b) 130
c) 140
d) 90
View Answer
Explanation: In HTML one can use a color name to specify a color e.g. Tomato, Orange, DodgerBlue, MediumSeaGreen, Gray, SlateBlue, Violet, LightGray etc. For colored fonts, we used text-decoration property to set the color of the text.
2. Which of the following is not set with font-style property?
a) font-style: normal
b) font-style: italic
c) font-style: oblique
d) font-style: capitalize
View Answer
Explanation: Text-transform: capitalize, capitalizes the first letter of each word whereas font-style set font as normal, italic, oblique. We use text-transform: uppercase and text-transform: lowercase to change the text from lowercase to uppercase and from uppercase to lowercase respectively.
3. What should be set with text-align property so that every line has equal width like in magazines and newspapers?
a) text-align: justify
b) text-align: none
c) text-align: bottom
d) text-align: top
View Answer
Explanation: By setting text-align property to “justify”, each line is stretched so that every line has equal width, left and right margins are straight like in magazines and newspapers. Text-align: center, text-align: right, text-align: left is also used for aligning the text at center, right and left respectively.
4. Which of the following is not used with text-decoration property?
a) overline
b) underline
c) line-through
d) inline
View Answer
Explanation: overline, underline, line-through properties are used to decorate the text.
Syntax: h1{text-decoration: line-through; }, h2 {text-decoration: overline ;}, h3{text-decoration: underline;}
it will produce headings h1 with text having line-through, h2 with text having overline and h3 with text having underline.
5. Which works similar to <i> element?
a) <strong>
b) <em>
c) <b>
d) <blockquote>
View Answer
Explanation: <strong> element shows the importance of text/paragraph between it’s tags. <b></b> makes text bolder. A section which is quoted from another source is specified by <blockquote>. <em> element indicates emphasis, browser will show the contents of <em> element in italic.
<p>I <em>like</em> dog.</p>
Output: I like dog.
6. Which works similar to <b> element?
a) <strong>
b) <em>
c) <i>
d) <blockquote>
View Answer
Explanation: The words written inside <strong> can be said with strong emphasis. Browser shows contents written inside <strong> element in bold.
<p><strong>Dog is</strong> an animal.</p>
Output: Dog is an animal.
7. Which element is used for short quote?
a) <q>
b) <blockquote>
c) <em>
d) <abbr>
View Answer
Explanation: <em> element indicates emphasis, browser will show the contents of <em> element in italic. A section which is quoted from another source is specified by <blockquote>. The <abbr> defines abbreviation. We used <q> element for shorter quote. Browser put quote around <q> element.
<p>This is a <q>black dog</q>.</p>
Output: This is a “black dog”.
8. Which element is used for abbreviation or acronym?
a) <em>
b) <q>
c) <abbr>
d) <blockquote>
View Answer
Explanation: <em> element indicates emphasis, browser will show the contents of <em> element in italic. We used <q> element for shorter quote. Browser put quote around <q> element. A section which is quoted from another source is specified by <blockquote>. For using, abbreviation or acronym <abbr> element is helpful. A title element is to be used with abbr.
<p>The <abbr title=”Doctor”>Dr.</abbr> is on the way.</p>
Output: The Dr. is on the way.
9. What is the work of <address> element?
a) contains contact details for author
b) contains IP address
c) contains home address
d) contains url
View Answer
Explanation: The contact details for author of a page is specified by <address> attribute. The content is often displayed in italics,
e.g. <address> <a href="mailto:[email protected]">Sanfoundry</a> </address>
Output:
Sanfoundry
10. To show deleted text, which element is used?
a) <ins>
b) <del>
c) <em>
d) <strong>
View Answer
Explanation: <strong> element shows the importance of text/paragraph between it’s tags. <em> element indicates emphasis, browser will show the contents of <em> element in italic. <ins> element shows the content that has been inserted, usually it has underline. <del> element shows text that has been deleted from, usually it has a line through the content.
<p>This is <del>not</del> for deletion </p>
Output: This is not for deletion.
11. Which element is used to show inserted element?
a) <ins>
b) <del>
c) <strong>
d) <em>
View Answer
Explanation: <del> element shows text that has been deleted from, usually it has a line through the content. <strong> element shows the importance of text/paragraph between it’s tags. <em> element indicates emphasis, browser will show the contents of <em> element in italic. <ins> element shows the content that has been inserted, usually it has underline.
<p>This is the <ins>inserted </ins> element.</p>
Output: This is the inserted element.
12. How <bdo> element works?
a) override text direction
b) stops writing in the current text direction
c) only override direction of rtl text
d) only changes the direction of ltr text
View Answer
Explanation: For bidirectional override of current text direction, we used <bdo> element, e.g. <bdo dir=”rtl”>Text is right to left</bdo>. This element was already there before HTML5. It is supported by all the browsers.
13. Which property is similar to C/C++ can be applied to comments?
a) for loop
b) while loop
c) ifelse
d) switch case
View Answer
Explanation: We can add conditional comments in our web page using if and endif, e.g. <!–[if age 9]>..text….<![endif]–>, there is no provision of “for” or “while” loop in HTML, same apply with switch case also.
14. Which element defines a title of the Work?
a) <abbr>
b) <cite>
c) <address>
d) <blockquote>
View Answer
Explanation: For using, abbreviation or acronym <abbr> element is helpful. The contact details for author of a page is specified by <address> attribute. A section which is quoted from another source is specified by <blockquote>. The tittle of a Work is defined by <cite> elements, usually it displays in italics.
<p><cite>Hamlet</cite> by William Shakespeare</p>
Output: Hamlet by William Shakespeare.
15. For smaller text which element is used?
a) <tiny>
b) <min>
c) <small>
d) <em>
View Answer
Explanation: min is an attribute for input method for inserting minimum value. smaller text is define by <small>element. <em> is used for emphasis usually it is display in italics.
<p>This is text in <small>small</small>.</p>
Output: This is text in small.
Sanfoundry Global Education & Learning Series – HTML.
To practice all areas of HTML, here is complete set of 1000+ Multiple Choice Questions and Answers.
If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]
- Check HTML Books
- Apply for Computer Science Internship
- Practice MCA MCQs
- Practice Computer Science MCQs
- Check Computer Science Books