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

Multiple choice technology web technology
  1. style

  2. font

  3. class

  4. styles

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

The correct answer is A. "style" is the HTML attribute used to define inline styles. This attribute is applied directly to the HTML element and allows you to specify CSS styles for that particular element.

Let's go through the other options and explain why they are incorrect:

B. "font": This attribute is not used to define inline styles. It was commonly used in older versions of HTML to specify font-related styles, but it is now considered deprecated and should be avoided.

C. "class": The "class" attribute is used to define a class for an HTML element, which can be used to apply styles defined in CSS. However, it is not specifically used for defining inline styles.

D. "styles": This is not a valid HTML attribute. The correct attribute is "style".

So, the correct answer is A. "style".

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 syntax uses: selector { property: value; }. The selector (body) is followed by curly braces containing property-value pairs separated by colons. Option A shows this correctly. Option B reverses the order, Option C uses invalid syntax, and Option D uses a colon incorrectly.

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

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

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

  4. None of the above

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

CSS uses element selectors directly followed by property declarations in curly braces. The background-color property sets the background color, and #FFFFFF represents white in hex color notation. Options B and C use incorrect selector syntax with 'all' keyword.

Multiple choice technology web technology
  1. <p style="text-size:bold">

  2. p {font-weight:bold}

  3. <p style="font-size:bold">

  4. p {text-size:bold}

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

The font-weight property controls text boldness in CSS. Option B uses correct CSS syntax: 'p' selector with font-weight:bold property declaration. Options A and C incorrectly mix inline style syntax with wrong property names.

Multiple choice technology programming languages
  1. /text

  2. /doc

  3. /xml

  4. /help

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

The C# compiler switch /doc extracts XML documentation comments (///) from source code and generates an XML documentation file. Options /text, /xml, and /help are not valid compiler switches for this purpose. The /doc switch is commonly used for generating API documentation.

Multiple choice technology web technology
  1. <style src="mystyle.css">

  2. <stylesheet>mystyle.css</stylesheet>

  3. <link rel="stylesheet" type="text/css" href="mystyle.css">

  4. None of the above

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

The correct HTML syntax for linking an external style sheet is using the element with rel='stylesheet', type='text/css', and href pointing to the CSS file. The element is for internal styles, not external linking. Option C shows the standard, W3C-recommended syntax that works across all browsers.

Multiple choice technology web technology
  1. font

  2. styles

  3. style

  4. class

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

The style attribute allows you to apply CSS directly to individual HTML elements. It's written as style="property: value;" and takes precedence over external or internal styles. The class attribute references external classes, while font is not a valid style attribute.

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

  2. {body:color=black(body}

  3. body {color: black}

  4. body:color=black

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

CSS syntax requires a selector, followed by curly braces containing property-value pairs separated by colons. Each declaration ends with a semicolon. Option C shows correct syntax: body {color: black;} where body is the selector and color: black is the declaration.

Multiple choice technology programming languages
  1. The type of tag used

  2. The version of the markup language that the source uses

  3. The document type declaration

  4. None

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

The document type declaration (DOCTYPE) informs the parser or markup processor about the specific rules and DTD/schema to use when interpreting the document's tags. While the language version is related, it is the DOCTYPE declaration itself that explicitly instructs the processor. Tag types alone do not define interpretation rules.

Multiple choice technology programming languages
  1. LANGUAGE tag

  2. Document type definition

  3. TYPE tag

  4. Document tag

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

A Document Type Definition (DTD) tells markup language processors which rules to use to interpret a document. DTDs define the structure, elements, and attributes allowed in a document, providing the validation rules. LANGUAGE and TYPE tags are not standard markup concepts.