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
πŸ’¬ Discuss
βœ… Correct Answer: (B) ii
Explanation:

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) i β†’ Wrong, because <p> inside <ul> is invalid.
  • (C) i and ii β†’ Wrong, because only ii is correct.
  • (D) None of the mentioned β†’ Wrong, because ii is correct.

Thus, the correct answer is (B) ii βœ….

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) i β†’ Wrong, because <p> inside <ul> is invalid.
  • (C) i and ii β†’ Wrong, because only ii is correct.
  • (D) None of the mentioned β†’ Wrong, because ii is correct.

Thus, the correct answer is (B) ii βœ….

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
298
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Harikesh
Publisher
πŸ“ˆ
91%
Success Rate