HTML Questions & Answers – Major Themes of (X)HTML

This set of HTML Interview Questions and Answers for freshers focuses on “Major Themes of (X)HTML”.

1. Which tag is used if you want to highlight something that is important to the reader?

a) <b>
b) <strong>
c) <em>
d) <i>
View Answer
Answer: a
Explanation: : The <b> tag is used to make the text bold. The <strong> tag is used to highlight the importance of text. The <em> tag is emphasis tag and is displayed in italic by browser. <i> tag is used to write text in italic font.
 
 
2. Which tag is not used if you want to indicate the importance of the phrase?

a) <i>
b) <h1>
c) <em>
d) <strong>
View Answer
Answer: a
Explanation: Tags like <h1> (including all headings from h1 to h6), <em> and <strong> can be used to indicate the importance of the phrase. The <i> is none other than a type of font displaced in italic bond by the browsers.
 
 
3. Which of the following statement is not true?

a) XHTML DOCTYPE is mandatory
b) The xmlns attribute in <html> is mandatory
c) <html>, <head>, <title>, and <body> are mandatory
d) None of the mentioned
View Answer
Answer: d
Explanation: XHTML is a markup language. There are certain terms and conditions (rules and regulations) for it. There are as: 1) In XHTML, the DOCTYPE is compulsory, 2) Xmlns attribute in <html> in manndatory, 3) The basic building blocks of markup i.e. <html>, <head>, <title>, and <body> are must in one. 4) Last but not least, XHTML is case sensitive where as HTML is case in-sensitive.
 
 

4. According to the rules of XML and XHTML, all elements must be closed either with an end tag or by self-closing with space, slash, and a right-pointing angle bracket.
a) True
b) False
View Answer

Answer: a
Explanation: XML and XHTML are markup languages used for creating web pages. XHTML is case sensitive, and thus they must be closed either an end tag or by self-closing with a space, slash, and a right pointing angle bracket. Ex) <p></p> is paragraph tag closed with ending tag. <br/> is break tag whose closing is done either by a slash or right pointing angle bracket.
advertisement
advertisement
Note: Join free Sanfoundry classes at Telegram or Youtube

5. __________ is the XML equivalent to strict HTML 4.01.
a) XHTML 1.0 Strict
b) XHTML 1.0 Frameset
c) XHTML 1.0 Transitional
d) XHTML 1.1 Strict
View Answer

Answer: a
Explanation: XML is a markup language while XHTML is a extensible hypertext markup language. XHTML 1.0 Strict is the XML equivalent to strict HTML 4.01, and includes elements and attributes that have not been marked deprecated in the HTML 4.01 specification.

6. Which of the following statement is true?
a) Attribute names must be in uppercase
b) Attribute values must be quoted
c) Attribute minimization is mandatory
d) Attribute values should not be quoted
View Answer

Answer: b
Explanation: HTML is hypertext markup language. There are many rules and regulations in HTML for attribute specification. HTML is case in-sensitive and thus we can write attribute name in either uppercase or lowercase, none of it is going to make difference. There is nothing like that atrribute name should be minimized, we can write attribute name as long as and as short as we want. The only rule for attribute name is that it should be in quoted form.
advertisement

7. The root element of an XHTML document must be html, and must contain an __________ attribute to associate it with the XHTML namespace.
a) source
b) src
c) xmlns
d) link
View Answer

Answer: c
Explanation: The xmlns attribute specifies the xml namespace for a document. It is manadatory in XHTML while in HTML5 it is optional. The root element of an XHTML document must be html, and must contain an xmlns atrribute to associate it with the XHTML namespace.

8. Which of the following encoding an XML parser assumes?
a) UTF-8
b) UTF-16
c) UTF-32
d) Both UTF-8 and UTF-32
View Answer

Answer: d
Explanation: Basically parsers are used in softwares and they convert user data into machine data in short in memory form to use. In XML, parser is used to read XML. If an XML document lacks encoding specification, an XML parser assumes that the encoding is UTF-8 or UTF-16.
advertisement

9. __________ is an extended version of the XHTML markup language for supporting RDF through a collection of attributes and processing rules in the form of well-formed XML documents.
a) XHTML + RDFa
b) XHTML+XHTML5
c) XHTML1.0+XHTML2.0
d) XHTML + RDF
View Answer

Answer: a
Explanation: XHTML+RDFa (Extensible Hypertext Markup Language + Resource Description Framework in attributes) is an extended version of the XHTML markup language for supporting RDF through a collection of attributes and processing rules in the form of well-formed XML documents.

10. XML is a markup language where documents must be marked up correctly.
a) True
b) False
View Answer

Answer: a
Explanation: XML is markup language while XHTML is extensible hypertext version of markup language. XHTML is HTML defined as an XML application. XHTML is stricter than HTML.

Sanfoundry Global Education & Learning Series – HTML.

To practice all areas of HTML for Interviews, 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]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.