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
Correct answer
Explanation
When an .aspx page is requested, ASP.NET processes the server-side code and renders the final output as HTML to send to the browser. This is because browsers can only render HTML, CSS, and JavaScript - they cannot directly execute ASP.NET code. The server processes all .NET code and converts it to standard HTML before transmission.
-
< asp:label >
-
< asp:listitem >
-
< asp:button >
A
Correct answer
Explanation
The asp:Label control is specifically designed to display text on a web page in ASP.NET. Unlike standard HTML labels or other controls, the Label server control provides a clean way to add text programmatically with server-side functionality. ListItem is used in list controls, and Button is for click actions, not text display.
-
Add Tag prefix, Tag name
-
Add Source, Tag prefix
-
Add Src, Tagprefix, Tagname
C
Correct answer
Explanation
The @Register directive for a User Control (.ascx) requires three specific attributes: 'Src' (the path to the file), 'TagPrefix' (the namespace alias), and 'TagName' (the name used in the HTML markup). This allows the parser to locate and instantiate the control.
-
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.
-
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.
-
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.
-
<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.
D
Correct answer
Explanation
To answer this question, we need to understand the concept of HTML tags.
Option A) DT - This option is incorrect because the <dt> tag is used to define a term in a description list, but it is not a two-sided tag.
Option B) LI - This option is incorrect because the <li> tag is used to define a list item in an ordered or unordered list, but it is not a two-sided tag.
Option C) DD - This option is incorrect because the <dd> tag is used to define a description in a description list, but it is not a two-sided tag.
Option D) DL - This option is correct because the <dl> tag is used to define a description list in HTML. It is a two-sided tag because it has an opening <dl> tag and a closing </dl> tag.
Therefore, the correct answer is option D) DL. This option is correct because the <dl> tag is a two-sided tag.