HTML MCQ Quiz - Objective Question with Answer for HTML - Download Free PDF

Last updated on Jun 12, 2025

Latest HTML MCQ Objective Questions

HTML Question 1:

To declare the version of XML, the correct syntax is:

  1. <> xml version = '1.0'/>
  2. <* xml version ='1.0/>
  3. None of the above

Answer (Detailed Solution Below)

Option 2 :

HTML Question 1 Detailed Solution

Concept:

XML stands for extensible markup language which lets you define your own tags in the order they occur. It is derived from SGML (Standard Generalized markup language).

Explanation:

XML is a platform-independent language. It is used to store and organize the data. The first line in the XML document is the XML prolog which includes XML declaration, DOCTYPE, version and comments. XML documents must contain a root element. In XML1.0, all things in the prolog are optional while for version 1.1, declaration is required in the prolog.

Syntax for declaring the version of XML is :

XML is slightly different from HTML. In html, we have predefined tags, while in XML we have to define our own tags. XML .XML is used for storing and transporting the data. Using the XML sharing of data between two programs on different platforms is possible. 

HTML Question 2:

In an HTML page, the tag is used to embed an image, and its attribute specifies the path of the image to be displayed.

  1. src
  2. path
  3. source
  4. root
  5. None of the above

Answer (Detailed Solution Below)

Option 1 : src

HTML Question 2 Detailed Solution

Key Points

 The tag is used to embed an image in an HTML page. src - Specifies the path to the image. alt - Specifies an alternate text for the image, if the image for some reason cannot be displayed.

Syntax:

alternatetext

src Attribute= The required src attribute specifies the path (URL) to the image.

Example:

Smiley face

Hence the correct answer is src.

HTML Question 3:

In HTML5, which of the following tag is used to initialize the document type ?

  1. <\Doctype html>

Answer (Detailed Solution Below)

Option 4 :

HTML Question 3 Detailed Solution

The correct answer is option 4:

Key Points

  • is the correct way to declare the document type in HTML5.
  • It is a declaration that must appear at the very top of an HTML document, before the tag.
  • It tells the web browser that the document is written in HTML5, ensuring proper rendering.
  • It is not case-sensitive but is conventionally written in uppercase for clarity.

Additional Information

  • Option 1 – : ❌ Incorrect syntax; HTML tags should be enclosed within <> and DOCTYPE is not a tag but a declaration.
  • Option 2 – <\Doctype html>: ❌ Incorrect; uses an invalid backslash and incorrect capitalization.
  • Option 3 – : ❌ Incomplete and incorrect declaration; not valid in HTML5.
  • Option 4 – : ✅ Correct declaration for HTML5 documents.

Hence, the correct answer is: option 4:

HTML Question 4:

Which of the following language we use to style an HTML document?

  1. CSS
  2. Java++ 
  3. C++
  4. Java

Answer (Detailed Solution Below)

Option 1 : CSS

HTML Question 4 Detailed Solution

The correct answer is CSS.

Key Points

  • CSS (Cascading Style Sheets) is used to style and layout web pages—for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.
  • CSS is a cornerstone technology of the World Wide Web, alongside HTML and JavaScript.
  • It is the standard way to style web pages and is supported by all modern web browsers.

Additional Information

  • Java++ - There is no programming language known as Java++. This option might be intended to confuse or check the aspirant's knowledge about programming languages.
  • C++ - C++ is a general-purpose programming language created as an extension of the C programming language. It is used for developing desktop applications, games, and system software but not typically for styling web pages.
  • Java - Java is a high-level, class-based, object-oriented programming language designed to have as few implementation dependencies as possible. It is commonly used for building application software, web applications, and large systems. However, it is not used for styling web pages.

HTML Question 5:

Match List - I with List - II.

List - I

List - II

A.

HTML

I.

Allow for dynamic and interactive web pages.

B.

DHTML

II.

Defines the structure of web pages.

C.

XML

III.

Object-oriented programming language for web applications.

D.

JAVA

IV.

Used for data storage and transport.


Choose the correct answer from the options given below:

  1. (A) - (I), (B) - (III), (C) - (II), (D) - (IV)
  2. (A) - (II), (B) - (III), (C) - (IV), (D) - (I)
  3. (A) - (II), (B) - (I), (C) - (IV), (D) - (III)
  4. (A) - (III), (B) - (I), (C) - (IV), (D) - (II)

Answer (Detailed Solution Below)

Option 3 : (A) - (II), (B) - (I), (C) - (IV), (D) - (III)

HTML Question 5 Detailed Solution

The correct answer is (A) - (II), (B) - (I), (C) - (IV), (D) - (III)

Key Points

  • HTML:
    • HTML (HyperText Markup Language) defines the structure of web pages. It is used to create and design web pages by structuring content and layout. So, A matches with II.
  • DHTML:
    • DHTML (Dynamic HTML) allows for dynamic and interactive web pages. It is not a language but a collection of technologies used together to create interactive and animated websites by using a combination of HTML, CSS, and JavaScript. So, B matches with I.
  • XML:
    • XML (eXtensible Markup Language) is used for data storage and transport. It is designed to store and transport data, with a focus on simplicity, generality, and usability across the Internet. So, C matches with IV.
  • JAVA:
    • JAVA is an object-oriented programming language used for web applications among many other types of applications. It is known for its portability across platforms and robust performance. So, D matches with III.

Therefore, the correct option is (A) - (II), (B) - (I), (C) - (IV), (D) - (III). So, the correct option is 3).

Top HTML MCQ Objective Questions

Which among the following is not an HTML tag?