📊 HTML
Q. State whether the given statement is true or false. !DOCTYPE is case sensitive”
  • (A) True
  • (B) False
  • (C) ---
  • (D) ---
💬 Discuss
✅ Correct Answer: (B) False

Explanation:

The !DOCTYPE declaration in HTML is not case-sensitive. It can be written in any combination of uppercase and lowercase letters, and it will still work correctly. However, the convention is to write it in uppercase for readability and consistency.

Example (Both are valid):

<!DOCTYPE html>
<!doctype html>

In HTML5, !DOCTYPE is primarily used to specify that the document follows HTML5 rules and does not trigger quirks mode in browsers.

📊 HTML
Q. 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) In both traditional XHTML and HTML close tag for some elements is optional
  • (D) None of the mentioned
💬 Discuss
✅ Correct Answer: (B) In traditional HTML close tag for some elements is optional but not encouraged

Explanation:

In traditional HTML, some elements like <p>, <li>, <td>, <tr>, and <option> do not necessarily require a closing tag, though it is generally recommended to include them for better readability and maintainability.

  • In XHTML, all elements must have a closing tag or be self-closing (e.g., <br />, <img />).
  • The close tag is not optional in XHTML but can be optional in HTML.

Thus, option (B) is the most accurate statement.

📊 HTML
Q. Which of the following is not a difference between HTML and XHTML
  • (A) Charset in html is “text/html” where as in xhtml it is “application/xml+xhtml”
  • (B) Tags and attributes are case-insensitive in HTML but not in XHTML
  • (C) Special characters must be escaped using character entities in XHTML unlike HTML
  • (D) None of the mentioned
💬 Discuss
✅ Correct Answer: (D) None of the mentioned

Explanation:

All the given options correctly describe differences between HTML and XHTML:

MIME Type

  • HTML uses text/html as its MIME type.
  • XHTML uses application/xml+xhtml or application/xhtml+xml for better XML parsing.

Case Sensitivity

  • In HTML, tag and attribute names are case-insensitive (e.g., <div> is the same as <DIV>).
  • In XHTML, they must be lowercase (e.g., <div> is valid, but <DIV> is not).

Special Characters Handling

  • In XHTML, special characters like <, >, and & must be written as character entities (&lt;, &gt;, &amp;).
  • In HTML, browsers are more forgiving about unescaped special characters.

Since all the given options correctly highlight actual differences, the correct choice is (D) None of the mentioned.

📊 HTML
Q. What indicates the content in file is HTML when delivered on the network.
  • (A) The extension of the file “.html”
  • (B) The “content-type” header
  • (C) Both “.html” extension and “content-type” header
  • (D) None of the mentioned
💬 Discuss
✅ Correct Answer: (B) The “content-type” header

Explanation: When a file is delivered over a network (e.g., via HTTP), the Content-Type header in the HTTP response specifies the type of content being sent. For HTML files, this header is usually:

Content-Type: text/html

The file extension (.html) helps browsers and operating systems identify files locally, but it is not used in network communication. The web server determines how to serve the file based on its configuration and sends the appropriate Content-Type header.

📊 HTML
Q. State whether the given statement is true or false. “We can intermix XHTML and HTML 4.01 documents”
  • (A) True
  • (B) False
  • (C) ---
  • (D) ---
💬 Discuss
✅ Correct Answer: (B) False

Explanation:

XHTML is a stricter, XML-based version of HTML 4.01.

  • Since XHTML follows XML rules, it can be mixed with HTML 4.01, but only under certain conditions.
  • If the document follows HTML 4.01 standards, it should use text/html as its MIME type.
  • If the document follows XHTML standards, it should use application/xhtml+xml as its MIME type.

Intermixing Conditions:

  • If an HTML 4.01 document contains XHTML content, it must be properly closed and well-formed.
  • Many modern browsers support mixing XHTML inside HTML documents.
  • However, the reverse (HTML inside strict XHTML) might not always work.

Thus, the statement "We can intermix XHTML and HTML 4.01 documents" is True but with certain restrictions.

📊 HTML
Q. HTML and XHTML stands for
  • (A) Hyper Text Markup Language and EXtensible HyperText Markup Language
  • (B) Hyper Text Markup Language and EXtensible HyperText Marking Language
  • (C) Hyper Text Marking Language and EXtensible HyperText Marking Language
  • (D) None of the mentioned
💬 Discuss
✅ Correct Answer: (A) Hyper Text Markup Language and EXtensible HyperText Markup Language

Explanation:

HTML (Hyper Text Markup Language) is the standard language for creating web pages and web applications.

  • XHTML (EXtensible HyperText Markup Language) is a stricter and more XML-compliant version of HTML.
  • XHTML follows XML rules, meaning tags must be properly nested, closed, and lowercase.

Thus, option A is the correct choice.

📊 HTML
Q. Choose the correct tag for largest heading in HTML.
  • (A) h6
  • (B) heading
  • (C) h1
  • (D) head
💬 Discuss
✅ Correct Answer: (C) h1

Explanation:

HTML provides six heading tags: h1 to h6.

  • h1 represents the largest and most important heading.
  • h6 represents the smallest heading.
  • <heading> is not a valid HTML tag.
  • <head> is used for metadata and not for headings.

Thus, h1 is the correct choice for the largest heading in HTML.

📊 HTML
Q. Which of the following are table tags?
  • (A) table, thead, tr, td
  • (B) colspan, table, tr
  • (C) table, tt, tr, td
  • (D) none of the mentioned
💬 Discuss
✅ Correct Answer: (A) table, thead, tr, td

Explanation:

In HTML, table-related tags include:

  • <table> → Defines a table.
  • <thead> → Defines the header section of a table.
  • <tr> → Defines a table row.
  • <td> → Defines a table cell (data cell).

Why other options are incorrect?

  • (B) colspan, table, trcolspan is an attribute, not a tag.
  • (C) table, tt, tr, td<tt> (teletype text) is not a table tag.
  • (D) none of the mentioned → Incorrect because option (A) contains valid table tags.

Thus, option (A) is the correct answer.

📊 HTML
Q. Choose the correct XHTML for width attribute and its value.
  • (A) width=80
  • (B) width=”80″
  • (C) WIDTH=”80″
  • (D) WIDTH=80
💬 Discuss
✅ Correct Answer: (B) width=”80″

Explanation:

In XHTML, all attributes must:

  1. Be in lowercase → XHTML is case-sensitive, so width (not WIDTH) is correct.
  2. Have values enclosed in quotes → Attribute values must be enclosed in double (" ") or single (' ') quotes.

Why other options are incorrect?

  • (A) width=80Incorrect because the value must be enclosed in quotes.
  • (C) WIDTH="80"Incorrect because XHTML is case-sensitive, and WIDTH should be width.
  • (D) WIDTH=80Incorrect because both uppercase and missing quotes violate XHTML rules.

Thus, the correct answer is (B) width="80" ✅.

📊 HTML
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) 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 ✅.