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
-
<HTML>
-
HTML
-
<%HTML%>
-
"HTML"
A
Correct answer
Explanation
HTML tags are enclosed in angle brackets, with the tag name inside. The syntax is for opening tags. Option A shows which is correct. Option B is just the text without brackets, C uses <% %> which is JSP/ASP syntax, and D uses quotes which are not tag delimiters.
-
<line>
-
<hr>
-
<tr>
-
<horizontalline>
B
Correct answer
Explanation
The <hr> tag in HTML creates a horizontal rule (line) across the page. It's a self-closing tag that doesn't require content. Option A is not a standard HTML tag, C creates a table row, and D `` doesn't exist as a standard HTML element.
-
.html
-
.shtml
-
.webpage
-
.doc
A
Correct answer
Explanation
HTML files use the .html file extension as the standard. While .htm was used historically on older systems with 8.3 filename limitations, .html is the modern standard. Option B .shtml is for server-parsed HTML, C .webpage isn't a standard extension, and D .doc is for Microsoft Word documents.
-
<frameset columns="16%,84%">
-
<frameset rows="16%,84%">
-
<frameset table="100,100">
-
<frameset cols="100,150">
D
Correct answer
Explanation
The 'style' attribute in HTML is used to apply inline CSS directly to an element. For example:
Red text
. The 'class' attribute is for external/internal CSS, 'styles' is not a valid HTML attribute, and 'font' is a deprecated tag.
-
p {font-weight:bold}
-
p {text-size:bold}
-
<p style="text-size:bold">
-
<p style="font-size:bold">
A
Correct answer
Explanation
The correct CSS property for making text bold is 'font-weight' with value 'bold'. The selector 'p' targets all paragraph elements. Options B and D use non-existent properties ('text-size', 'font-size' for boldness). Option C uses inline style syntax but with an incorrect property.
-
Use the type selector with , delimiter
-
Use the ID selector with ; delimiter
-
Use the type selector with . delimiter
-
Use the ID selector with > delimiter
-
Apply the style to a specific element
-
Apply the style to all the elements
-
Apply the style to elements of the same type
-
Apply the style to a group of elements
-
body {color: black}
-
{body;color:black}
-
body:color=black
-
{body:color=black(body}
A
Correct answer
Explanation
Valid CSS syntax uses the selector followed by curly braces: selector { property: value }. Option A correctly shows 'body {color: black}' with proper syntax. Options B and D use incorrect brace placement, option C uses colon incorrectly and equals sign instead of braces.
-
Extensible MarkUp Language
-
Extra Modern Link
-
Extensible MakeUp Language
-
X-Markup Language
A
Correct answer
Explanation
XML stands for Extensible Markup Language, a text-based markup language designed to store and transport data in a structured, hierarchical format that is both human-readable and machine-readable.
-
Elements may have multiple atrribute with the same name
-
Quoting attribute is optional
-
Elements may nest but not overlap
-
All of the above.
C
Correct answer
Explanation
XML enforces well-formedness rules where elements must nest properly without overlapping - an end tag must match the most recent start tag. Attributes must be quoted and have unique names within an element.
-
</xml version="1.0"/>
-
<xml version="1.0">
-
<?xml version="1.0"/?>
-
none of the above
C
Correct answer
Explanation
XML declaration is a processing instruction that starts with and ends with ?>, making option C the correct syntax. This optional declaration specifies XML version and encoding at the document start.
-
<sample></sample>
-
<sample/>
-
None of the above
-
Option 1 & 2
D
Correct answer
Explanation
XML allows two equivalent syntaxes for empty elements: a full open/close tag pair with no content, or a self-closing shorthand. Both are valid and interchangeable.
-
<!-This is a comment->
-
<comment>This is a comment</comment>
-
<?-This is a comment->
-
All of the above.
A
Correct answer
Explanation
XML comments are delimited by , allowing documentation within XML documents that parsers ignore. Option A shows the correct syntax though the example appears to have a minor formatting issue.
D
Correct answer
Explanation
XML (eXtensible Markup Language) is a recommendation specified by the World Wide Web Consortium (W3C), the main international standards organization for the World Wide Web. The W3C XML specification was first published in 1998 and has gone through multiple versions (1.0, 1.1). W3C is responsible for maintaining and standardizing web technologies including HTML, CSS, and XML to ensure interoperability across different platforms and systems.