Computer Knowledge
Markup and Web Languages
1,492 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
-
<style src="mystyle.css">
-
<stylesheet>mystyle.css</stylesheet>
-
<link rel="stylesheet" type="text/css" href="mystyle.css">
-
None of the above
C
Correct answer
Explanation
The correct HTML syntax for linking an external style sheet is using the element with rel='stylesheet', type='text/css', and href pointing to the CSS file. The element is for internal styles, not external linking. Option C shows the standard, W3C-recommended syntax that works across all browsers.
-
<style>
-
<script>
-
<css>
-
None of the above
A
Correct answer
Explanation
The element is used to embed CSS rules directly within an HTML document. It's placed in the <head> section and contains CSS code between opening and closing tags. The <script> tag is for JavaScript, not CSS.
C
Correct answer
Explanation
The style attribute allows you to apply CSS directly to individual HTML elements. It's written as style="property: value;" and takes precedence over external or internal styles. The class attribute references external classes, while font is not a valid style attribute.
-
{body;color:black}
-
{body:color=black(body}
-
body {color: black}
-
body:color=black
C
Correct answer
Explanation
CSS syntax requires a selector, followed by curly braces containing property-value pairs separated by colons. Each declaration ends with a semicolon. Option C shows correct syntax: body {color: black;} where body is the selector and color: black is the declaration.
-
color:
-
bgcolor:
-
background-color:
-
None of the above
C
Correct answer
Explanation
The background-color CSS property is used to change an element's background color. The color property only changes text color, while bgcolor is an outdated HTML attribute that should not be used in modern CSS.
-
h1.all {background-color:#FFFFFF}
-
h1 {background-color:#FFFFFF}
-
all.h1 {background-color:#FFFFFF}
-
None of the above
B
Correct answer
Explanation
To style all elements of a specific type in CSS, you use the element selector directly. Therefore, h1 targets all <h1> elements. The other options use class selectors (.all or .h1), which would only target elements with those specific class names rather than all <h1> tags.
-
text-color:
-
color:
-
text-color=
-
fgcolor:
B
Correct answer
Explanation
The color CSS property is used to change the text color (foreground color) of an element. There is no text-color or fgcolor property in CSS. The property name is simply color, applied to the text content of the element.
-
The type of tag used
-
The version of the markup language that the source uses
-
The document type declaration
-
None
C
Correct answer
Explanation
The document type declaration (DOCTYPE) informs the parser or markup processor about the specific rules and DTD/schema to use when interpreting the document's tags. While the language version is related, it is the DOCTYPE declaration itself that explicitly instructs the processor. Tag types alone do not define interpretation rules.
-
LANGUAGE tag
-
Document type definition
-
TYPE tag
-
Document tag
B
Correct answer
Explanation
A Document Type Definition (DTD) tells markup language processors which rules to use to interpret a document. DTDs define the structure, elements, and attributes allowed in a document, providing the validation rules. LANGUAGE and TYPE tags are not standard markup concepts.
-
It describes the tags in existing languages
-
It defines new markup languages
-
It parses the code in existing markup languages
-
All
B
Correct answer
Explanation
A metamarkup language defines new markup languages. XML is the classic example - it's used to define other markup languages like XHTML, SVG, or custom XML applications. It doesn't describe or parse existing languages but provides the framework for creating new ones.
-
Programming events
-
Text appearance
-
Relationships between data
-
Text structure
B,D
Correct answer
Explanation
Markup languages like HTML or XML define document structure and formatting. Text appearance (B) is controlled through styling tags and attributes, while text structure (D) is defined through hierarchical element organization. Programming events and data relationships are handled by programming languages, not markup languages.
B
Correct answer
Explanation
XML was designed to complement HTML, not replace it. HTML defines the structure and presentation of web pages, while XML provides a flexible, extensible way to structure and describe data. They serve different purposes: HTML is for displaying information, XML is for storing and transporting structured data. The two technologies can work together (e.g., XHTML).
-
eXtra Style Language
-
eXpandable Style Language
-
eXtensible Style Listing
-
eXtensible Stylesheet Language
D
Correct answer
Explanation
XSL stands for eXtensible Stylesheet Language, a family of languages used to transform and render XML documents. It includes XSLT (for transformations), XSL-FO (for formatting), and XPath (for navigating XML documents). XSL defines how XML data should be displayed or converted to other formats.
-
XML uses a description node to describe data
-
XML uses a DTD to describe the data
-
XML uses XSL to describe data
-
None of the above
B
Correct answer
Explanation
A Document Type Definition (DTD) is a traditional way to describe the structure, elements, and attributes of an XML document. While XSL is used for styling and transforming XML data, it does not describe the data structure itself. Description nodes do not exist in standard XML.
B
Correct answer
Explanation
This XML document is NOT well-formed because the attribute value 'age=29' is not enclosed in quotes. XML requires all attribute values to be quoted (either single or double quotes). The correct syntax would be or . Well-formedness is a strict requirement - any violation of XML syntax rules makes the document invalid.