H

Harikesh • 8.04K Points
Tutor III

Q. Which of the following options follows content model in HTML?

Code:
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
  • Correct Answer - Option(B)
  • Views: 153
  • Filed under category HTML

Explanation by: Official MCQ Buddy

The correct answer is:

(B) ii

Explanation:

HTML follows a content model, meaning elements must be nested correctly according to HTML rules.

Code (i) is incorrect

<ul>
   <p>Option one</p>
</ul>
  • Incorrect because a <ul> (unordered list) can only contain <li> (list item) elements directly inside it.
  • <p> (paragraph) is not allowed as a direct child of <ul>.

Code (ii) is correct

<ul>
   <li>Option two</li>
</ul>
  • Correct because <ul> can only contain <li> elements, and <li> is properly placed inside <ul>.

Why other options are incorrect?

  • (A) iWrong, because <p> inside <ul> is invalid.
  • (C) i and iiWrong, because only ii is correct.
  • (D) None of the mentionedWrong, because ii is correct.

Thus, the correct answer is (B) ii ✅.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics