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

Multiple choice technology web technology
  1. split()

  2. document.clear()

  3. join()

  4. charAt()

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Among the options, charAt() is a standard string method that was supported in MSIE 3.x. It returns the character at a specified index in a string. Options A (split), B (document.clear), and C (join) were not supported in MSIE 3.x - these methods were added in later versions of JavaScript.

Multiple choice technology web technology
  1. The duration of the browser session.

  2. The duration the current document stays loaded.

  3. Twenty-four hours from the time the cookie is set.

  4. There is no default setting.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

By default, if the expires or max-age attribute is omitted from a cookie, it behaves as a session cookie. This means the cookie expires and is deleted when the user closes the browser session, making the first option correct.

Multiple choice technology web technology
  1. ("Hello World")

  2. document.write("Hello World")

  3. response.write("Hello World")

  4. "Hello World"

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

To write text to a webpage in JavaScript, you use document.write() which outputs content to the document. Option A is just a string literal, option C uses response.write() which is server-side, and option D is just a string without writing it to the document.

Multiple choice technology web technology
  1. <script type="text/javascript" name="javascript.js">

  2. <script type="text/javascript" src="javascript.js">

  3. <script type="text/javascript" href="javascript.js">

  4. <script type="text/javascript" link="javascript.js">

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The correct HTML tag to include an external JavaScript file is `with thesrcattribute pointing to the script's URL. Attributes likehref,link, orname` are incorrect for linking scripts in HTML.

Multiple choice technology web technology
  1. Both the <head> section and the <body> section are correct

  2. The <body> section

  3. The <head> section

  4. The <JavaScript> section

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

JavaScript can be inserted in both the section and the section of an HTML document. The section doesn't exist in HTML, and while both head and body work, the question asks for the correct place implying either is acceptable.

Multiple choice technology web technology
  1. body {color: black}

  2. body:color=black

  3. {body:color=black(body}

  4. {body;color:black}

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

CSS uses selector {property: value} syntax, where the selector targets an HTML element and the declaration block in braces contains styles. Option A correctly shows 'body {color: black}' with proper selector, braces, and property-value colon separator. Option B incorrectly uses equals sign instead of colon, Option C misplaces braces outside the selector, and Option D uses semicolon instead of colon before the value.

Multiple choice technology web technology
  1. background-color:

  2. bgcolor:

  3. color:

  4. backgroundcolor:

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The background-color property sets an element's background color in CSS. bgcolor is an obsolete HTML attribute (not CSS), while color only changes text color, not the background. Option D is incorrect because CSS uses hyphens in multi-word properties, making it 'background-color' not 'backgroundcolor'.

Multiple choice technology web technology
  1. all.h1 {background-color:#FFFFFF}

  2. h1 {background-color:#FFFFFF}

  3. h1.all {background-color:#FFFFFF}

  4. h1.all {color:#FFFFFF}

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

To style all elements of a type, use the element name directly as the selector without modifiers. 'h1 {background-color:#FFFFFF}' correctly targets all h1 elements. Options A and C incorrectly add '.all' which is not valid CSS syntax for targeting all elements of a type, and Option D changes the wrong property (color instead of background-color).

Multiple choice technology web technology
  1. Home Tool Markup Language

  2. Hyperlinks and Text Marking Language

  3. Hyper Text Markup Language

  4. Hyperlinks and Text Markup Language

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

HTML stands for Hyper Text Markup Language. 'HyperText' refers to links that connect pages, 'Markup' means tags that define elements, and 'Language' indicates it's a coding language. Options A, B, and D are incorrect expansions - HTML specifically uses 'Markup' not 'Marking' or 'Marking Language'.

Multiple choice technology web technology
  1. <body background="yellow">

  2. <background>yellow</background>

  3. <body style="background-color:yellow">

  4. <body color="background-color:yellow">

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Modern HTML uses inline CSS with the style attribute to add background color: . Option A uses the obsolete 'background' attribute, which is deprecated. Option B uses a non-existent tag, and Option D has incorrect attribute syntax ('color' with a colon-separated value isn't valid HTML).

Multiple choice technology web technology
  1. <input type="checkbox" />

  2. <check>

  3. <input type="check" />

  4. <checkbox>

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

HTML checkboxes are created using the input element with type="checkbox". Options B and D use non-existent HTML tags and , while option C uses type="check" which is not a valid input type. Option A is the only correct syntax.

Multiple choice technology web technology
  1. <img>image.gif</img>

  2. <image src="image.gif" />

  3. <img src="image.gif" />

  4. <img href="image.gif />

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Images in HTML are inserted using the self-closing img tag with the src attribute specifying the image path. Option A incorrectly uses closing tags, option B uses the non-existent tag, and option D uses 'href' instead of 'src'. Only option C uses the correct img tag syntax.