All Exams Test series for 1 year @ ₹349 only
Question

Which of the following is NOT a pair tag in HTML?

The correct answer is

<img>

Understanding HTML Pair Tags vs. Non-Pair Tags

In HTML, tags are used to structure and define content. Tags can be broadly categorized into two types: pair tags (also known as container tags) and non-pair tags (also known as empty tags or self-closing tags).

  • Pair Tags: These tags require both an opening tag and a closing tag. The content they affect is placed between the opening and closing tags. The closing tag has a forward slash / before the tag name. Examples include <p>...</p>, <div>...</div>, ..., and <title>...</title>.
  • Non-Pair Tags: These tags do not require a closing tag. They typically represent a self-contained element or insert something into the document. Examples include <br> (line break), <hr> (horizontal rule), and <img> (image).

Analyzing the Given HTML Tags

Let's examine each tag provided in the options to determine if it is a pair tag or not a pair tag:

  1. <img>: This tag is used to embed an image in an HTML page. It is an empty element, meaning it does not have a closing tag like </img> in standard HTML5. Therefore, it is a non-pair tag.
  2. <p>: This tag defines a paragraph. It requires both an opening <p> tag and a closing </p> tag to enclose the paragraph text. Thus, it is a pair tag.
  3. <i>: This tag is used to render text in italics. It requires both an opening <i> tag and a closing </i> tag around the text that needs to be italicized. Thus, it is a pair tag.
  4. <title>: This tag defines the title of the HTML document, which appears in the browser's title bar or tab. It requires both an opening <title> tag and a closing </title> tag around the title text. Thus, it is a pair tag.

Identifying the Non-Pair Tag

Based on the analysis:

  • <img> is a non-pair tag.
  • <p> is a pair tag.
  • <i> is a pair tag.
  • <title> is a pair tag.

The question asks which of the following is NOT a pair tag. The <img> tag is the one that fits this description.

HTML Tag Type Requires Closing Tag?
<img> Non-Pair Tag (Empty Tag) No
<p> Pair Tag (Container Tag) Yes
<i> Pair Tag (Container Tag) Yes
<title> Pair Tag (Container Tag) Yes

Therefore, the tag that is NOT a pair tag among the given options is <img>.

Revision Table: Key HTML Tag Types

Term Description Example
Pair Tag Requires both opening and closing tags. Encloses content. <p>Content</p>
Non-Pair Tag Does not require a closing tag. Self-contained or inserts something. <img src="image.jpg">
Container Tag Another name for Pair Tag. <div>Content</div>
Empty Tag Another name for Non-Pair Tag. <br>

Additional Information: Common HTML Tags

Understanding common HTML tags is crucial for web development. Here are a few examples of both types:

  • Common Pair Tags:
    • <html>: Root element of an HTML page.
    • <head>: Contains meta-information about the HTML document.
    • <body>: Contains the visible page content.
    • <h1> to <h6>: Headings.
    • <a>: Hyperlink.
    • <ul>, <ol>, <li>: Unordered lists, Ordered lists, List items.
    • <table>, <tr>, <td>: Table elements.
  • Common Non-Pair Tags:
    • <meta>: Metadata about the HTML document.
    • <link>: Defines the relationship between a document and an external resource (e.g., stylesheet).
    • <input>: Input field.
    • <hr>: Horizontal rule.
Was this answer helpful?

Important Questions from HTML

  1. Which of the following statements regarding XML is/are True ?

    (A) XML is a set of tags designed to tell browsers how to display text and images in a web page.

    (B) XML defines a syntax for representing data. but the meaning of data varies from application to application

    (C) < Letter >, < LETTER > and < letter > are three different tags in XML.

    Choose the correct answer from the options given below:

  2. Which of the statements given below is/are correct?

    It is always important and useful to include an 'alt' attribute on 'img' tag in HTML because

    A. users who cannot see the image due to vision impairment can have a textual description of the image (which can be spoken aloud by a screenreader).

    B. If the image fails to load (slow connection, broken path, etc.) then alt text is displayed instead.

    C. SEO (Search Engine Optimization) benefits.

    Choose the correct answer from the options given below :

  3. Which tag is used to enclose any number of javascript statements in HTML document?

  4. The definitions in an XML document are said to be_______ when the tagging system and definitions in the DTD are all in compliance.

  5. How many different levels of heading does HTML support?

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App