Development and production

Course Beginner Free

HTML — The basics

Build a semantic, accessible web page step by step with a running project: a recipe mini-blog.

  • 4 guides
  • 38 concepts
Start reading

Guides

  1. 01 Guide HTML glossary Explain the concepts in your own words and recognise them in an example. 14 concepts
  2. 02 Guide HTML essentials Choose and use the essential elements to complete this step of the blog. 11 concepts
  3. 03 Guide HTML workshop · À table ! Reproduce a working result, test it, then succeed at an exercise without copying. 7 concepts
  4. 04 Guide Resources and review Find reliable information and explain what you have built. 6 concepts

Suggested path

  1. 01. HTML: structure three recipes in a semantic page.
  2. 02. CSS: make the blog readable on mobile and on desktop.
  3. 03. JavaScript: filter the recipes without reloading the page.
  4. 04. PHP: produce the pages from arrays and process a form.
  5. 05. MySQL: keep the recipes in a relational database.
  6. 06. PDO: read and add recipes from PHP with prepared queries.

Sources and references

Beginner workshop, step 1/6. The complete files are materials to reproduce in a separate local project. Read the prerequisites, the expected results and the limits stated in the workshop.

Example files

index.html
<!doctype html>
<html lang="fr">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="À table ! Trois recettes faciles à préparer chez soi.">
  <title>À table ! · Recettes maison</title>
</head>
<body>
  <a href="#contenu" class="evitement">Aller au contenu</a>
  <header class="entete">
    <h1>À table !</h1>
    <p>Des recettes simples à partager.</p>
    <nav aria-label="Navigation principale">
      <a href="#recettes">Les recettes</a>
      <a href="#a-propos">À propos</a>
    </nav>
  </header>
  <main id="contenu" class="conteneur">
    <section id="recettes" aria-labelledby="titre-recettes">
      <h2 id="titre-recettes">Nos recettes maison</h2>
      <!-- Réservé au cours JavaScript : caché tant que le script ne fonctionne pas. -->
      <form id="filtres" hidden>
        <label for="recherche">Rechercher une recette</label>
        <input id="recherche" name="q" type="search" placeholder="Ex. : soupe">
        <label for="duree-max">Durée maximale</label>
        <select id="duree-max" name="duree">
          <option value="0">Toutes les durées</option>
          <option value="20">20 minutes</option>
          <option value="45">45 minutes</option>
        </select>
        <button type="reset">Réinitialiser</button>
      </form>
      <p id="compteur" role="status" aria-live="polite">3 recettes disponibles.</p>
      <p id="aucun" hidden>Aucune recette ne correspond. Essayez un autre mot.</p>
      <div class="recettes">
        <article id="soupe" class="recette" data-titre="Soupe de carottes" data-duree="20">
          <h3>Soupe de carottes</h3>
          <p class="meta">20 min · 2 personnes · Plat</p>
          <h4>Ingrédients</h4>
          <ul><li>4 carottes</li><li>1 oignon</li><li>500 ml d’eau</li></ul>
          <h4>Préparation</h4>
          <ol><li>Éplucher et couper les légumes.</li><li>Cuire dans l’eau 15 minutes puis mixer.</li></ol>
        </article>
        <article id="salade" class="recette" data-titre="Salade de tomates" data-duree="10">
          <h3>Salade de tomates</h3>
          <p class="meta">10 min · 2 personnes · Entrée</p>
          <h4>Ingrédients</h4>
          <ul><li>3 tomates</li><li>1 cuillère d’huile d’olive</li><li>Quelques feuilles de basilic</li></ul>
          <h4>Préparation</h4>
          <ol><li>Laver et couper les tomates.</li><li>Ajouter l’huile et le basilic, mélanger.</li></ol>
        </article>
        <article id="tarte" class="recette" data-titre="Tarte aux pommes" data-duree="45">
          <h3>Tarte aux pommes</h3>
          <p class="meta">45 min · 4 personnes · Dessert</p>
          <h4>Ingrédients</h4>
          <ul><li>1 pâte brisée</li><li>3 pommes</li><li>2 cuillères de compote</li></ul>
          <h4>Préparation</h4>
          <ol><li>Préchauffer le four à 180 °C et étaler la pâte.</li><li>Garnir de compote et de pommes puis cuire 30 minutes.</li></ol>
        </article>
      </div>
    </section>
    <section id="a-propos">
      <h2>À propos</h2>
      <p>Ce mini-blog est notre projet d’apprentissage du développement web.</p>
    </section>
  </main>
  <footer class="pied"><p>À table ! · Un projet de L’Akadémie du Digital</p></footer>
</body>
</html>

In the same series Step 1 of 6

  1. 1 Course HTML — The basics You are here
  2. 2 Course CSS — The basics
  3. 3 Course JavaScript — The basics
  4. 4 Course PHP — The basics
  5. 5 Course MySQL — The basics
  6. 6 Course PDO — The basics

Share this article

In the same category

Course

Development and production · Intermediate

Node.js — The fundamentals

Understand the Node.js runtime: modules, asynchronous code, npm and building a small server.

4 guides · 44 concepts In the same series

Course

Development and production · Beginner

CSS — The basics

Style the recipe mini-blog and make it responsive: selectors, box model, flexbox, grid and mobile-first.

4 guides · 39 concepts In the same series

Course

Development and production · Beginner

JavaScript — The basics

Make the page interactive: variables, functions, the DOM and events to filter recipes without reloading.

4 guides · 38 concepts In the same series