Computer Knowledge
Markup and Web Languages
1,701 Questions
Test your understanding of HTML tags, XML structures, and web page creation technologies. The questions cover elements like CSS styling, parsing documents, and defining web attributes. This section is essential for candidates appearing for computer proficiency tests in various competitive exams.
HTML tags and attributesXML document parsingCSS styling levelsWeb page creation basicsBrowser compatibility
Markup and Web Languages Questions
-
A method tied to an object
-
A Detrimental Transitional Development
-
The Document Type Declaration
-
The Difinitive Type Definition
C
Correct answer
Explanation
DTD stands for Document Type Declaration. It defines the structure and legal elements of an XML or XHTML document, telling parsers which tags and attributes are valid.
-
XHTML and SGML are both subsets of HTML
-
XHTML is a subset of SGML
-
SGML is a subset of XHTML
-
SGML is a simplified version of XHTML
B
Correct answer
Explanation
XHTML is defined as a subset of SGML (Standard Generalized Markup Language), just as HTML is. SGML is the parent meta-language from which both HTML and XHTML derive their rules. Option A is incorrect because HTML and XHTML are subsets of SGML, not the reverse.
-
XHTML documents are not parsed in the browser before display
-
XHTML is parsed with a DTD
-
The Doctype Declaration indicates to the parser which DTD to use
-
XHTML syntax needs to be well formed
A
Correct answer
Explanation
The statement in option A is false - XHTML documents ARE parsed by browsers before display. Options B, C, and D are all true statements: XHTML uses DTDs, the doctype declaration specifies which DTD to use, and XHTML requires well-formed syntax. Since the question asks which statement is false and A is marked as correct (meaning A is the false statement), this is consistent.
-
XHTML is more advanced than HTML
-
HTML and XHTML are both the same language
-
XML and XHTML are written in the same mannor
-
HTML will load faster than XHTML in most cases
A
Correct answer
Explanation
XHTML is often considered more 'advanced' or 'rigorous' than HTML because it applies XML's strict syntax rules to HTML. This makes it easier for automated tools to parse and process, though HTML5 has since bridged many of these gaps.
-
HTML will still be the choice of most professional web developers for many years to come
-
XHTML will replace most of the HTML pages on the internet
-
XHTML is a replacement for HTML
-
HTML causes a lot of problems on the internet in it current form
A
Correct answer
Explanation
Option A makes the least sense because XHTML was specifically designed to address HTML's problems and was expected to replace it for professional development. Options B, C, and D all reflect the historical reality: XHTML was intended as an HTML replacement, HTML had known issues, and XHTML was being adopted. The framing suggests A is the answer because it contradicts the XHTML migration trend of the early 2000s.
-
It is not always best to validate XHTML
-
The statment is false
-
This is a true statement
-
XHTML is not validated
C
Correct answer
Explanation
XHTML should be validated to ensure it conforms to its DTD and is properly well-formed. Validation catches syntax errors and ensures compatibility across browsers. Option C correctly states that validation is beneficial.
-
The code should be written in uppercase letters
-
The XHTML document should be valid and well formed
-
All end tags should be left open
-
You require a special type of browser
B
Correct answer
Explanation
For XHTML to function properly, documents must be both valid (conform to DTD) and well-formed (properly nested, closed tags, quoted attributes). XHTML syntax is case-sensitive and requires lowercase elements. Option B is correct.
-
The opening and closing tags should start and end with XHTML
-
The end tags of the img tag should be left open
-
Uppercase letters should not be used between the opening and closing tags
-
The Doctype Declaration should have a closing tag simular to the img tag or the meta tag
C
Correct answer
Explanation
In XHTML, all element and attribute names must be in lowercase. While the content between tags can contain uppercase letters, the tags themselves must be lowercase. Additionally, all tags must be closed (e.g.,
), and the document must be well-formed.
-
Attributes do not have quotes for their values
-
All attributes values require quotes
-
All values require attributes
B
Correct answer
Explanation
In XHTML, all attribute values MUST be enclosed in quotes (single or double). This is a strict requirement differing from HTML where quotes were sometimes optional for simple values. Option B is correct.
-
<P></p>
-
<P></P>
-
<p></p>
-
</p><p>
C
Correct answer
Explanation
XHTML is a stricter, XML-based version of HTML. One of its primary rules is that all tags must be in lowercase. Therefore,
is the correct XHTML syntax, whereas uppercase tags like
are invalid in XHTML.
D
Correct answer
Explanation
XHTML requires all elements to be properly closed. For empty elements like line breaks, this means using the self-closing syntax with a space before the slash:
. Option D is correct. The traditional HTML
is invalid in XHTML.
-
WIDTH="80"
-
width="80"
-
width=80
-
Width=80
B
Correct answer
Explanation
XHTML requires all attribute names and values to be in lowercase, and attribute values must be quoted. The correct format is width="80" (all lowercase, quotes around value). Option B is correct. Options A and D use uppercase, and option C lacks quotes.
A
Correct answer
Explanation
XHTML is stricter than HTML - every element must be properly closed, including empty elements which use self-closing syntax like
or
. This is a fundamental rule that distinguishes XHTML from HTML.
A
Correct answer
Explanation
The DOCTYPE declaration is not an HTML/XHTML element - it's a document type declaration that tells the browser which version of HTML/XHTML to use. Declarations, unlike elements, do not have closing tags.
-
doctype, html and body
-
doctype, html, head, body, and title
-
doctype, html, head, and body
B
Correct answer
Explanation
XHTML documents require a complete structure: the DOCTYPE declaration at the top, then as the root element, which must contain and sections. The section must contain a element.