ExamVeda
Login
Home
1
State whether the given statement is true or false. !DOCTYPE is case sensitive”
Discuss
Answer & Solution
Answer: Option B
Solution:
In XML it is while in HTML it is not.
2
Choose the correct statement of HTML
Discuss
Answer & Solution
Answer: Option B
Solution:
Option B is the correct answer.

In traditional HTML, the closing tag for certain elements is optional according to the HTML specification. For example, elements such as <li>, <p>, <tr>, and <td> may omit their closing tags because browsers can infer where the element ends. However, omitting closing tags is generally not encouraged since explicitly closing elements improves code readability, maintainability, and compatibility.

Why Option A is incorrect:

In XHTML, every element must be properly closed because XHTML is based on XML. Omitting a closing tag results in an invalid XHTML document. Therefore, it is incorrect to say that closing tags are optional in traditional XHTML.

Why Option C is incorrect:

Option C states "None of the mentioned". This is incorrect because Option B correctly describes the behavior of traditional HTML regarding optional closing tags.

Why Option D is incorrect:

Option D claims that closing tags are optional in both HTML and XHTML. This is false because only HTML allows certain closing tags to be omitted. XHTML follows strict XML syntax, which requires every element to have a corresponding closing tag or to be written as a self-closing element where appropriate.

Therefore, Option B is the correct answer because traditional HTML permits omission of closing tags for some elements, whereas XHTML requires all elements to be properly closed.
3
Which of the following is not a difference between HTML and XHTML
Discuss
Answer & Solution
Answer: Option A
Solution:
Option A is the correct answer.

The question asks for the statement that is not a valid difference between HTML and XHTML. Option A is incorrect because it contains factual errors. It refers to text/html and application/xml+xhtml as character sets (charsets), whereas they are actually MIME (Content) Types. In addition, the correct MIME type for XHTML is application/xhtml+xml, not application/xml+xhtml. Since the statement itself is incorrect, it cannot be considered a valid difference between HTML and XHTML.

Why Option B is incorrect:

Option B states "None of the mentioned", which would be correct only if all the other options described valid differences. However, Option A is factually incorrect, so not all the listed statements are valid differences. Therefore, Option B cannot be the correct answer.

Why Option C is incorrect:

Option C states that tags and attributes are case-insensitive in HTML but not in XHTML. This is a genuine difference. HTML parsers generally treat tag and attribute names without regard to case, whereas XHTML follows XML rules and is case-sensitive. For example, <BODY> is accepted in HTML, but XHTML requires <body>. Since this statement correctly describes a difference, it is not the answer.

Why Option D is incorrect:

Option D states that special characters must be escaped using character entities in XHTML. XHTML is based on XML and therefore follows strict XML syntax rules. Characters such as &, <, and > must be escaped wherever required to ensure the document is well-formed. HTML is generally more forgiving and may tolerate certain unescaped characters in situations where XHTML would produce a parsing error. Therefore, this option also describes a valid difference.

Hence, Option A is the only statement that is not a valid difference because it incorrectly describes MIME types as charsets and uses an invalid MIME type for XHTML.
4
What indicates the content in file is HTML when delivered on the network.
Discuss
Answer & Solution
Answer: Option B
Solution:
Content-type: header indicates the content in file is html.
5
State whether the given statement is true or false. “We can intermix XHTML and HTML 4.01 documents”
Discuss
Answer & Solution
Answer: Option B
Solution:
HTML 4.01 and XHTML are different versions of HTML with slightly different rules.

HTML 4.01 is more lenient and allows some coding errors.

XHTML is stricter and requires well-formed code, meaning elements must be properly nested and closed.

You can't directly combine parts of an XHTML document with parts of an HTML 4.01 document in the same file and expect it to work correctly in all browsers. The browser will likely try to interpret the entire document using one set of rules, which will lead to errors or unexpected behavior.

Therefore, the statement "We can intermix XHTML and HTML 4.01 documents" is False.
6
HTML and XHTML stands for
Discuss
Answer & Solution
Answer: Option A
Solution:
HTML and XHTML are abbreviated as mentioned in the correct option.
7
Choose the correct tag for largest heading in HTML.
Discuss
Answer & Solution
Answer: Option C
Solution:
h1 is the largest while h6 is the smallest by convention for headings in HTML.
8
Which of the following are table tags?
Discuss
Answer & Solution
Answer: Option A
Solution:
Table tags in HTML are used to create and structure tables. They include various tags to define the table structure, rows, headers, and data cells.

Option A: table, thead, tr, td - This is the correct answer. These tags are all used in defining a table in HTML:

table - Defines the table itself.

thead - Defines the header section of the table.

tr - Defines a table row.

td - Defines a table data cell.

Option B: colspan, table, tr - This is incorrect. While table and tr are table tags, colspan is an attribute, not a tag.

Option C: table, tt, tr, td - This is incorrect. While table, tr, and td are table tags, tt is not a table tag; it represents teletype text.

Option D: none of the mentioned - This is incorrect because Option A correctly lists table tags.
9
Choose the correct XHTML for width attribute and its value.
Discuss
Answer & Solution
Answer: Option B
Solution:
Always mention the attribute value in quotes and XHTML is case sensitive.
10
Which of the following options follows content model in HTML?
i.<ul>
   <p>Option one </p>
  </ul>
ii.<ul>
    <li>Option two </li>
   </ul>
Discuss
Answer & 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.