Vidyalelo
HTML · Q10

Basic HTML

Programming · HTML · question 10

Q10

Which of the following options follows content model in HTML? i. Option one ii. Option two

A.
i
B.
ii
Answer
C.
i and ii
D.
None of the mentioned

Answer: Option B

Solution

Answer: Option B
Solution:
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.