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

What is the syntax for using the *ngIf directive in Angular?

  1. <div *ngIf="condition">My Element

  2. <div [ngIf]="condition">My Element

  3. <div ngIf="condition">My Element

  4. None of the above

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

To use the *ngIf directive in Angular, you specify the condition that you want to evaluate in the *ngIf attribute. If the condition is true, the element will be displayed. If the condition is false, the element will be hidden.

Multiple choice

Which CSS property is used to define the direction of an animation?

  1. animation-direction

  2. transition-direction

  3. animation-timing-function

  4. transition-timing-function

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

The animation-direction property specifies whether an animation should play forwards, backwards, or in alternate directions.

Multiple choice

Which CSS property is used to specify the fill mode of an animation?

  1. animation-fill-mode

  2. transition-fill-mode

  3. animation-timing-function

  4. transition-timing-function

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

The animation-fill-mode property specifies how the animated element should appear before the animation starts and after it ends.

Multiple choice

What is the purpose of the XMLHttpRequest object?

  1. To send and receive HTTP requests

  2. To parse JSON data

  3. To create HTML elements

  4. To handle events

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

The XMLHttpRequest object is used to send and receive HTTP requests in JavaScript.

Multiple choice

What are the different states of an XMLHttpRequest object?

  1. UNSENT, OPENED, HEADERS_RECEIVED, LOADING, DONE

  2. NEW, CONNECTED, SENDING, RECEIVING, CLOSED

  3. REQUEST, RESPONSE, ERROR, ABORTED

  4. PENDING, ACTIVE, COMPLETED

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

The XMLHttpRequest object goes through different states during its lifetime: UNSENT, OPENED, HEADERS_RECEIVED, LOADING, DONE.

Multiple choice

How can you handle the response of an XMLHttpRequest request?

  1. Using the onload event

  2. Using the onreadystatechange event

  3. Using the onprogress event

  4. All of the above

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

You can handle the response of an XMLHttpRequest request using the onload, onreadystatechange, and onprogress events.

Multiple choice

What is the purpose of the status property in XMLHttpRequest?

  1. To indicate the status code of the response

  2. To indicate the state of the request

  3. To indicate the size of the response

  4. To indicate the type of the response

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

The status property in XMLHttpRequest indicates the status code of the response.

Multiple choice

What does HTML stand for?

  1. Hypertext Markup Language

  2. Hypertext Modeling Language

  3. Hypertext Machine Language

  4. Hypertext Markup Link

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

HTML stands for Hypertext Markup Language, a markup language used to create the structure and content of web pages.

Multiple choice

Which HTML element is used to define the main content of a web page?

  1. <head>

  2. <body>

  3. <title>

  4. <html>

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

The <body> element in HTML defines the main content of a web page, where the actual content is placed.

Multiple choice

What is the correct syntax for creating a heading in HTML?

  1. <h1>Heading</h1>

  2. <heading>Heading</heading>

  3. <h>Heading</h>

  4. <head>Heading</head>

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

In HTML, headings are created using the <h1> to <h6> elements, with <h1> being the most prominent heading.

Multiple choice

Which HTML attribute is used to specify the link destination of an anchor (<a>) element?

  1. href

  2. src

  3. alt

  4. title

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

The 'href' attribute in the <a> element specifies the link destination, allowing users to navigate to another web page or section of the current page.

Multiple choice

What is the purpose of the <meta> tag in HTML?

  1. To define the title of the web page

  2. To provide metadata about the web page

  3. To create a link to another web page

  4. To insert an image into the web page

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

The <meta> tag in HTML is used to provide metadata about the web page, such as its title, description, keywords, and other information relevant to search engines and web crawlers.

Multiple choice

Which HTML element is used to create a bulleted list?

  1. <ul>

  2. <ol>

  3. <li>

  4. <dl>

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

The <ul> element in HTML is used to create an unordered (bulleted) list, where each item is represented by a list item (<li>).

Multiple choice

What is the correct syntax for creating a table in HTML?

  1. <table><thead><tr><th>Heading</th></tr></thead><tbody><tr><td>Data</td></tr></tbody></table>

  2. <table><tr><th>Heading</th></tr><tr><td>Data</td></tr></table>

  3. <table><thead><tr><td>Heading</td></tr></thead><tbody><tr><th>Data</th></tr></tbody></table>

  4. <table><tr><td>Heading</td></tr><tr><td>Data</td></tr></table>

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

In HTML, a table is created using the <table> element, with <thead> for the table header, <tbody> for the table body, <tr> for table rows, and <th> and <td> for table headings and data cells respectively.

Multiple choice

Which HTML element is used to create a form?

  1. <form>

  2. <input>

  3. <button>

  4. <label>

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

The <form> element in HTML is used to create a form that allows users to input data, such as text, numbers, or selections, and submit it to a server for processing.