QCM : Web Development Fundamentals — 9 questions

Questions et réponses du QCM

1. What is an HTML tag?

A special attribute used to style elements
A component enclosed in angle brackets that defines elements in a webpage
A type of CSS selector used for styling
A script written in JavaScript to manipulate HTML elements

A component enclosed in angle brackets that defines elements in a webpage

Explication

An HTML tag is a fundamental component of HTML, enclosed within angle brackets < >, used to define elements in a webpage's structure. The other options describe attributes, CSS selectors, or JavaScript scripts, which are different concepts.

2. Which HTML tags are used to define the hierarchical structure of headings on a webpage?

<img>
<a>
<h1> to <h6>
<p>

<h1> to <h6>

Explication

The <h1> to <h6> tags are specifically used to define headings of different levels, establishing the content hierarchy on a webpage, as explicitly stated in the content.

3. What is the primary function of the HTML <img> tag and its attributes?

To define alternative text for images for accessibility
To style images with CSS properties like color and font
To create clickable links to images or other pages
To embed images into a webpage and specify their source and size

To embed images into a webpage and specify their source and size

Explication

The <img> tag is used to embed images into a webpage, with the 'src' attribute specifying the image source and the 'width' attribute controlling the size, often as a percentage for responsiveness. The other options describe different functionalities not directly related to the core purpose of the <img> tag.

4. When was the HTML <link> tag established as a standard feature in HTML?

In 2000, with HTML 4.01
In 2014, with HTML5 standard
In 1995, with the publication of HTML 2.0
In 1989, with the first HTML specification

In 1995, with the publication of HTML 2.0

Explication

The <link> tag was introduced as part of HTML 2.0, published in 1995, making it the period when it was established as a standard feature in HTML.

5. How does the <script> tag in JavaScript integration differ from or resemble other HTML tags?

The <script> tag creates a visual element on the page, similar to <div> or <span>.
The <script> tag is used specifically to embed JavaScript code into the webpage, unlike tags like <img> or <a> which embed media or links.
The <script> tag is used to embed CSS styles into the webpage.
The <script> tag is placed inside the <head> section only, unlike other tags that can be placed anywhere.

The <script> tag is used specifically to embed JavaScript code into the webpage, unlike tags like <img> or <a> which embed media or links.

Explication

The <script> tag is specifically used to embed JavaScript code into a webpage, which makes it different from tags like <img> or <a> that embed images or links. It is similar to other HTML tags in that it is an element used for integration purposes, but its purpose is unique to JavaScript.

6. Who is credited with proposing the core concepts of variables and objects in JavaScript?

Brendan Eich
James Gosling
Tim Berners-Lee
Douglas Crockford

Brendan Eich

Explication

Brendan Eich is credited with designing JavaScript and proposing its core features, including variables and objects, when he created the language in 1995. The other options are influential figures in computing but are not credited with JavaScript's core concepts.

7. What is a consequence of JavaScript finding HTML elements by their id attribute in web development?

It automatically styles elements with matching ids.
It allows JavaScript to manipulate specific elements dynamically.
It disables user interaction with the element.
It prevents other scripts from accessing the element.

It allows JavaScript to manipulate specific elements dynamically.

Explication

Finding HTML elements by their id attribute enables JavaScript to directly manipulate those elements, which is essential for creating interactive and dynamic webpages. This method allows scripts to update content, respond to events, and modify styles programmatically.

8. How do you apply a CSS style rule to an HTML element with a specific ID?

Use the element name directly, like div
Use a class selector with a dot, like .idName
Use an ID selector with a hash, like #idName
Use an attribute selector, like [id='idName']

Use an ID selector with a hash, like #idName

Explication

To apply CSS styles to an element with a specific ID, you use the ID selector, which is denoted by a hash (#) followed by the ID value. For example, '#idName { color: red; }' targets the element with id='idName'. The other options are incorrect: class selectors target classes, not IDs; using the element name targets all such elements; and attribute selectors target elements with specific attributes but are not the standard way to target IDs directly.

9. What is the correct CSS selector syntax to target an HTML element with a specific id?

*#idname
.idname
idname
#idname

#idname

Explication

In CSS, to target an element with a specific id, the selector uses the '#' symbol followed by the id value. For example, '#idname' targets the element with id='idname'. The '.' prefix is used for class selectors, 'idname' without any prefix is invalid, and '*#idname' is not a valid selector syntax.

Révisez avec les flashcards

Mémorisez les réponses avec 18 flashcards sur Web Development Fundamentals.

HTML tags — definition?

Building blocks for webpage structure.

< > — purpose?

Enclose HTML tags.

Paired tags — example?

<h1> and </h1>.

Voir les flashcards →

Approfondir avec la fiche

Consultez la fiche de révision complète sur Web Development Fundamentals.

Voir la fiche →

Cours similaires

Crée tes propres QCM

Importe ton cours et l'IA génère des QCM avec corrections en 30 secondes.

Générateur de QCM