HTML MCQs – HTML Basic Structure and Elements

11.) What is the function of the <head> tag in HTML?

A) It defines the main heading of the document.
B) It contains metadata about the document.
C) It defines the body content of the document.
D) It specifies the title of the web page.

Answer: Option B

Explanation: The <head> tag contains metadata about the HTML document, such as the document title, character encoding, and links to stylesheets and scripts.

12.) Which tag is used to define the largest heading in HTML?

A) <heading>
B) <h1>
C) <h6>
D) <head>

Answer: Option B

Explanation: The <h1> tag is used to define the largest heading in HTML, which represents the most important heading on the page.

13.) What does the <br> tag define in HTML?

A) A line break
B) A paragraph
C) A heading
D) A hyperlink

Answer: Option A

Explanation: The <br> tag defines a line break in HTML, which is used to create a new line without starting a new paragraph.

14.) What is the purpose of the <meta> tag in HTML?

A) It defines the main content of the document.
B) It specifies the document’s character encoding.
C) It defines a list of metadata keywords.
D) It creates a hyperlink to another webpage.

Answer: Option B

Explanation: The <meta> tag is used to specify metadata about the HTML document, such as the character encoding used to interpret the document’s content.

15.) Which tag is used to create an ordered list in HTML?

A) <ol>
B) <ul>
C) <li>
D) <list>

Answer: Option A

Explanation: The <ol> tag is used to create an ordered list in HTML, where list items are numbered sequentially.

16.) What is the purpose of the <link> tag in HTML?

A) It creates a hyperlink to another webpage.
B) It specifies the title of the web page.
C) It defines the main content of the document.
D) It links an external resource, such as a stylesheet.

Answer: Option D

Explanation: The <link> tag is used to link an external resource, such as a stylesheet or icon, to the HTML document, allowing for styling and customization.

17.) Which HTML tag is used to create a horizontal rule (line) in HTML?

A) <hr>
B) <line>
C) <rule>
D) <horizontal>

Answer: Option A

Explanation: The <hr> tag is used to create a horizontal rule, which is a visible line that separates content in HTML documents.

18.) Which HTML5 attribute is used to specify a short hint that describes the expected value of an input field?

A) placeholder
B) hint
C) description
D) valuehint

Answer: Option A

Explanation: The placeholder attribute is used to provide a short hint or example of the expected value of an input field in HTML5 forms.

19.) Which tag is used to create an ordered list with lowercase Roman numerals in HTML?

A) <ol type=”i”>
B) <ol type=”I”>
C) <ol type=”a”>
D) <ol type=”A”>

Answer: Option A

Explanation: The <ol> tag with the type attribute set to “i” is used to create an ordered list with lowercase Roman numerals in HTML.

20.) Which tag is used to create a hyperlink that opens in a new browser window or tab?

A) <a href=”#” target=”_self”>
B) <a href=”#” target=”_blank”>
C) <a href=”#” target=”_parent”>
D) <a href=”#” target=”_top”>

Answer: Option B

Explanation: The target attribute with the value “_blank” is used to make a hyperlink open in a new browser window or tab.

Leave a Reply

Your email address will not be published. Required fields are marked *