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
-
("Hello World")
-
"Hello World"
-
document.write("Hello World")
-
response.write("Hello World")
C
Correct answer
Explanation
JavaScript uses document.write() to output text to an HTML document. Options A and B are just string expressions without any output method.
-
The <head> section
-
The <body> section
-
Both the <head> section and the <body> section are correct
-
none
C
Correct answer
Explanation
JavaScript can be placed in both and sections. The placement affects execution timing - scripts run before page load, scripts run after.
-
<script name="xxx.js">
-
<script src="xxx.js">
-
<script href="xxx.js">
-
none
B
Correct answer
Explanation
The src attribute in the tag references an external JavaScript file. The name and href attributes are not valid for this purpose.
B
Correct answer
Explanation
External JavaScript files use a .js extension and contain only JavaScript code, not HTML. The tag is used in HTML files to reference external JS files, but the external file itself contains pure JavaScript without any tags.
-
<!--This is a comment-->
-
//This is a comment
-
'This is a comment
-
?this is a comment ?
B
Correct answer
Explanation
JavaScript uses double forward slashes (//) for single-line comments. Option A () is HTML comment syntax, not JavaScript. Options C and D are not valid comment syntax in any language.
-
It is used to indicate ownership of content
-
It is used to flag inappropriate content
-
It refers to keyword that users attach to content
-
It is used to indicate featured content on a website
C
Correct answer
Explanation
A tag is a user-defined keyword or metadata term assigned to a piece of information or media content, facilitating taxonomy and search. It does not indicate ownership, flag inappropriate content, or specify featured website content, which are handled by authorization rules, moderation flags, and administrative settings respectively.
A
Correct answer
Explanation
HTML headings range from H1 to H6, where H1 represents the highest (most important) level and is displayed with the largest font size by default. H6 is the smallest heading level. Each page should typically have only one H1 element.
A
Correct answer
Explanation
To solve this question, the user needs to have basic knowledge of HTML. The user should know that HTML is a markup language that has a defined set of rules for writing valid code.
The correct answer is:
A. Syntax
Option A is the correct answer because the set of rules that govern the structure and format of HTML code is called its syntax. The syntax of HTML follows a specific set of rules that define how elements can be combined to create valid web pages.
Option B is incorrect because tags are the building blocks of HTML elements and are used to define and format content.
Option C is incorrect because dialog is not related to HTML; it is a user interface component that displays content to the user.
Option D is incorrect because HTML does not have laws; it has rules that define the structure and format of valid HTML code.
Therefore, the correct answer is:
The Answer is: A. Syntax
D
Correct answer
Explanation
META tags (like description, keywords, viewport, charset) are always placed in the section of an HTML document. The head contains metadata about the document that isn't displayed on the page itself but is used by browsers and search engines. The body contains visible content.
-
<dir>
-
<bdo>
-
<dfn>
-
<!doctype>
B
Correct answer
Explanation
The (Bi-Directional Override) tag is used to override the default text direction for a specific portion of text. It's commonly used with the dir attribute (ltr or rtl) to force text direction. The tag is deprecated, is for definitions, and declares the document type.
-
<script>
-
<optgroup>
-
<samp>
-
C
Correct answer
Explanation
The tag is specifically designed to display sample output from computer programs or scripts in a monospace font, distinguishing it from normal text. contains code, <optgroup> groups options, and <sup> creates superscript text - none represent program output.
-
Defines a menu list
-
Defines metadata about an HTML document
-
Defines an embedded object
-
Defines an image.
A,C,D
Correct answer
Explanation
HTML defines headings from
through - all of these are valid. does not exist in HTML. Therefore h3, h5, and h6 are correct heading tags while h7 is invalid.
B,C
Correct answer
Explanation
The question asks for tags defining 'scripted text', which is a common typographical typo in older HTML quizzes referring to 'subscript' (<sub>) and 'superscript' (<sup>) tags. The `tag defines client-side scripts, and<strike>` defines strikethrough text.
-
Defines a caption for a fieldset element
-
Defines a label for an input element
-
Defines an input control
-
Defines a searchable index related to a document
A
Correct answer
Explanation
The tag specifically provides a caption or title for a element, grouping related form controls. is for individual inputs, creates controls, and no tag defines a searchable index by default.