Écrire du HTML
Introduit| English | Sens |
|---|---|
| HTML/ˌeɪtʃ tiː em ˈel/ | HTML |
| attribute/ˈætrɪbjuːt/ | attribut |
| element/ˈelɪmənt/ | élément |
| semantic elements/səˈmæntɪk ˈelɪmənts/ | éléments sémantiques |
It looks like a link, but Tab skips it
- A styled rectangle saying “Join” is not automatically a working link. A real anchor with a destination has browser behaviour that styling alone does not supply.
- HTML 超文本标记语言 gives content structure and meaning. CSS controls presentation; choosing meaningful HTML also supports keyboard and assistive-technology use.
Pourquoi utiliser un élément de titre réel pour le titre d'une page ?
Difficulté 1/5 · 100 pièces + un petit bonus lors de la première réussite aujourd'hui
Un titre décrit la structure du document. L'apparence peut ensuite être contrôlée avec CSS.
Read the tag and its attributes
- An element 元素 often has a start tag, content and an end tag:
<p>Meet on Thursday.</p>. An attribute 属性 supplies information in the start tag:<a href="join.html">Join</a>. - An HTML void element such as
imghas no end tag or child content. It does not “close itself”; a trailing slash is unnecessary in HTML. Nest paired tags without crossing them.
Quel attribut définit la destination de navigation d'un lien hypertexte ?
Difficulté 1/5 · 100 pièces + un petit bonus lors de la première réussite aujourd'hui
Un lien tel que Comment s'inscrire utilise href.
Mark the page regions by purpose
- Semantic elements 语义化元素 include
navfor major navigation andmainfor the page's main content. Use headings to describe sections anddivfor a generic grouping when no more specific element fits. - A native
awithhrefnavigates; a nativebuttonperforms an action. Semantic markup helps, but labels, behaviour and focus still need testing.

Quels éléments ont ces significations HTML spécifiques ? Sélectionnez toutes les options applicables.
Difficulté 2/5 · 140 pièces + un petit bonus lors de la première réussite aujourd'hui
div est générique. Utilisez un élément plus spécifique lorsque son but défini correspond.
Faites correspondre l'intention avec un élément natif approprié.
Difficulté 2/5 · 140 pièces + un petit bonus lors de la première réussite aujourd'hui
Les éléments natifs fournissent du sens et un comportement par défaut, mais ils nécessitent toujours des étiquettes exploitables et des tests.
Build a small complete page
- Save this example as
index.htmlbeside a realjoin.html. Open it in a browser and follow the link using Tab and Enter. langidentifies the page language;titlenames the browser tab. The viewport setting lets responsive styles use the device width.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Robotics club</title>
</head>
<body>
<nav aria-label="Main"><a href="join.html">How to join</a></nav>
<main>
<h1>Robotics club</h1>
<p>Meet Thursday at 4 pm in room 12.</p>
</main>
</body>
</html>
<a href="join.html">How to join</a> combines a destination and a useful label. <div class="link">Click here</div> provides neither native navigation nor a destination.
Choose alternatives by the image's purpose
- An informative image needs an alternative conveying its relevant meaning. A purely decorative image normally uses
alt=""so assistive technology can skip it. - For an image used as a link, describe the link's function when that information is not otherwise supplied. A complex chart also needs its important data explained in text.
Do not use headings merely to enlarge text, or repeat “image” as every alternative. Equally, do not give decorative images lengthy descriptions that interrupt the page.
Un graphique informatif nécessite un texte alternatif qui transmette ses informations clés, pas seulement « image ».
Difficulté 1/5 · 100 pièces + un petit bonus lors de la première réussite aujourd'hui
Vrai. Le texte alternatif doit fournir l'information pertinente ; un graphique complexe peut également avoir besoin de ses données importantes en texte.
Un article de journal d'un club utilise une photographie montrant des élèves plantant des arbres dans la cour d'école. Rédigez un texte alternatif utile.
Difficulté 3/5 · 200 pièces + un petit bonus lors de la première réussite aujourd'hui
Exemple : « Élèves plantant des arbres dans la cour d'école. » N'inventez pas un nombre qui n'a pas été fourni.
Une petite décoration à côté d'un titre n'apporte aucune information. Quelle alternative d'image correspond généralement ?
Difficulté 1/5 · 100 pièces + un petit bonus lors de la première réussite aujourd'hui
Une alternative vide permet aux technologies d'assistance de sauter une image purement décorative.
Verify structure and behaviour
- Check the heading order, meaningful link labels, keyboard use and image alternatives. An HTML validator can detect markup errors, but cannot judge whether your wording is useful.
- Make the meeting page usable with styles turned off. Then style the content without changing headings into appearance-only shortcuts.
Choose HTML by purpose. Use native links and buttons, valid nesting and image alternatives that match the image's role.
Sources: HTML syntax and W3C decorative images.
En HTML, img est un élément vide et ne doit pas avoir de balise de fin.
Difficulté 1/5 · 100 pièces + un petit bonus lors de la première réussite aujourd'hui
Les éléments vides n'ont aucun contenu enfant ni balise de fin. Une barre oblique finale est inutile ; elle ne confère pas aux éléments HTML un comportement auto-fermant.