Examveda

Which of the following options follows content model in HTML?
i.<ul>
   <p>Option one </p>
  </ul>
ii.<ul>
    <li>Option two </li>
   </ul>

A. i

B. ii

C. i and ii

D. None of the mentioned

Answer: Option B

Solution (By Examveda Team)

Option B is the correct answer.

According to the HTML content model, the <ul> (unordered list) element can contain only <li> (list item) elements as its direct children. Each <li> element may then contain text, paragraphs, images, links, or other valid HTML content.

Why Option i is incorrect:

In Option i, the <ul> element directly contains a <p> element. This violates the HTML content model because a paragraph cannot be a direct child of an unordered list. The correct structure is to place the paragraph inside an <li> element if needed.

Why Option ii is correct:

In Option ii, the <ul> element directly contains an <li> element, which is the required and valid structure for an unordered list. This follows the HTML specification for list elements.

Why Option A is incorrect:

Option A selects only i, which does not follow the HTML content model because the <ul> element contains an invalid direct child.

Why Option C is incorrect:

Option C states that both i and ii follow the content model. This is incorrect because only ii is valid.

Why Option D is incorrect:

Option D states that none of the options follow the content model. This is incorrect because ii is a valid HTML structure.

Therefore, only Option ii follows the HTML content model, making Option B the correct answer.

This Question Belongs to HTML >> Basic HTML

Join The Discussion

Comments (1)

  1. Vishakha Singh
    Vishakha Singh:
    2 months ago

    It is A

Related Questions on Basic HTML

Choose the correct statement of HTML

A. In traditional XHTML close tag for some elements is optional but not encouraged

B. In traditional HTML close tag for some elements is optional but not encouraged

C. None of the mentioned

D. In both traditional XHTML and HTML close tag for some elements is optional