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
-
TagPrefix
-
Name space of the dll that is referenced
-
Assemblyname
-
All of the above
D
Correct answer
Explanation
To use a custom control in an ASP.NET page, the @Register directive requires the TagPrefix (to identify the control in markup), the Namespace, and the Assembly name where the control is defined. Therefore, all these components are necessary for registration.
-
Scripting is separated from the HTML, Code is interpreted seperately
-
Scripting is separated from the HTML, Code is compiled as a DLL, the DLLs can be executed on server
-
Code is separated from the HTML and interpreted Code is interpreted separately
B
Correct answer
Explanation
Classic ASP was an interpreted scripting language (VBScript/JScript). ASP.NET introduced a compiled model where code is separated into code-behind files or script blocks that are compiled into DLLs (Intermediate Language), providing significantly better performance and type safety.
B
Correct answer
Explanation
Web user controls in ASP.NET use the .ascx file extension. The .aspx extension is for web forms pages, and .asmx is for XML web services. User controls are reusable components that can be embedded in multiple pages.
-
css
-
text/style
-
style
-
script
C
Correct answer
Explanation
The element is used to define CSS rules within an HTML document. It must be placed in the <head> section and contains CSS code that applies to the document, distinguishing it from <script> which is for JavaScript.
-
font
-
styles
-
css
-
text
-
style
E
Correct answer
Explanation
The style attribute allows CSS rules to be applied directly to HTML elements. It uses the same syntax as CSS but without selectors, and is called inline because the styles are written inside the HTML opening tag itself.
-
body {color: black}
-
body:color=black
-
{body:color=black(body}
-
{body;color:black}
A
Correct answer
Explanation
CSS uses selector {property: value} syntax. The selector targets elements, curly braces contain the rules, properties are followed by colons, and value pairs end with semicolons. Option A shows this correctly with body as selector, color as property, and black as value.
-
bgcolor:
-
background-color:
-
color:
B
Correct answer
Explanation
The background-color property controls an element's background. The older HTML attribute bgcolor is deprecated, and color property controls text color, not background.
-
all.h1 {background-color:#FFFFFF}
-
h1.all {background-color:#FFFFFF}
-
h1 {background-color:#FFFFFF}
C
Correct answer
Explanation
To style all elements of a type, use the element name as the selector without modifiers. The selector h1 targets all
elements in the document, and the declaration sets their background color.
-
text-color:
-
color:
-
text-color=
-
font-color:
B
Correct answer
Explanation
The color property controls text color in CSS. Many beginners expect text-color or font-color, but the actual property is simply color, while background-color controls the element background.
-
p {text-size:bold}
-
p {font-weight:bold}
-
style:bold
-
p{font:bold}
B
Correct answer
Explanation
In CSS, the 'font-weight' property is specifically used to define the thickness of characters. Setting it to 'bold' makes the text heavy. 'text-size' is not a valid property (it is 'font-size'), and 'font:bold' is incomplete shorthand syntax.
B
Correct answer
Explanation
padding cannot be negative because it's internal space between an element's border and its content: you can't have less than zero space inside an element. Negative values are valid for margins but not padding.
-
<script>
-
<css>
-
<stylesheet>
-
<style>
D
Correct answer
Explanation
tags contain internal/embedded CSS within HTML head or body. Option A is for JavaScript, B and C are not valid HTML elements. The style element specifically holds CSS rules for the current page.
D
Correct answer
Explanation
The style attribute applies CSS directly to HTML elements inline. Option A is a common typo, B is for reusable classes, and C is not a valid attribute. Inline styles use style="property:value" syntax.
-
p {font-weight:bold}
-
p {text-size:bold}
-
<p style="text-size:bold">
-
<p style="font-size:bold">
A
Correct answer
Explanation
p {font-weight:bold} is correct CSS selector syntax targeting all paragraph elements. Options B and C use the non-existent text-size property, and D incorrectly uses font-size for boldness.
-
It makes Michelle strong
-
It highlights Michelle as being strong
-
It will print out Michelle in bold font
C
Correct answer
Explanation
The HTML tag renders its content in bold font and indicates strong importance (semantically stronger than ). Options A and B incorrectly interpret semantic meaning rather than visual rendering. In HTML, both and display bold text, but carries semantic meaning.