Welcome
M1 | The Technical Fundamentals of the Web M2 | Advanced CMS M3 | UX/UI Products M4 | Advanced Prototyping M5 | Advanced Integration & Core Project Training Bonus
About Log In Create Account
LMS Pro LMS Pro
  • Welcome
  • Web Production & Interface Training
    • Module 1 — Technical Fundamentals of the Web
    • Module 2 — Advanced CMS
    • Module 3 — Product UX & UI
    • Module 4 — Advanced Prototyping
    • Module 5 — Advanced Integration & Capstone Project
    • Bonus Module
  • About
  • Log In
  • Sign Up
Skip to content

LMS Pro

LMS Pro — Your platform to learn, grow, succeed

Professional Training

UX/UI Designer

CSS Typography: Mastering Text Formatting

Posted on 6 January 202623 January 2026 By LMS Pro No Comments on Typographie CSS : Maîtriser la Mise en Forme du Texte
Module 1 — Technical Fundamentals of the Web, Text & Semantics

Typographie CSS : Maîtriser la Mise en Forme du Texte

Explorez toutes les propriétés CSS pour styliser le texte : polices, tailles, couleurs, ombres, alignement et espacement. Créez des typographies professionnelles pour vos sites web.

Level : Débutant à Intermédiaire

Durée : 50 minutes

Target audience: Développeurs web, Designers, Intégrateurs

Objectifs pédagogiques

  • Maîtriser les propriétés de police de caractères
  • Comprendre les unités de taille de texte
  • Appliquer des effets visuels au texte
  • Optimiser la lisibilité du contenu

La propriété font-family définit la police utilisée pour afficher le texte.

Basic syntax

p {
font-family: Arial;
}

Pile de polices (Font Stack)

Spécifiez plusieurs polices en cas de fallback :

p {
font-family: "Trebuchet MS", Verdana, sans-serif;
}

Le navigateur essaiera chaque police dans l’ordre jusqu’à en trouver une disponible.

Les 5 familles génériques

Famille Description Example
serif Avec empattements Texte avec serif
sans-serif Sans empattements Texte sans-serif
monospace Largeur fixe Code monospace
cursive Style écriture Texte cursive
fantasy Décoratif Texte fantasy

Polices web sûres

Ces polices sont disponibles sur presque tous les systèmes :

  • Sans-serif : Arial, Helvetica, Verdana
  • Serif : Times New Roman, Georgia
  • Monospace : Courier New
💡 Bonne pratique : Les noms de police avec espaces doivent être entre guillemets : "Trebuchet MS"

La propriété font-size contrôle la taille du texte.

Unités principales

  • px : Pixels (unité absolue)
  • em : Relatif à la taille du parent
  • rem : Relatif à la taille de l’élément racine (html)

Méthode recommandée : rem

/* Base de 10px pour faciliter les calculs */
html {
font-size: 10px;
}

h1 {
font-size: 2.6rem; /* = 26px */
}

p {
font-size: 1.4rem; /* = 14px */
}

Comparaison em vs rem

/* Avec em - cascade complexe */
article { font-size: 1.5em; } /* 24px si parent = 16px */
article p { font-size: 0.833em; } /* 20px relatif au 24px */

/* Avec rem - toujours relatif à html */
article { font-size: 1.5rem; } /* 15px si html = 10px */
article p { font-size: 2rem; } /* 20px, simple ! */

Recommandation : Use rem pour les tailles de police. C’est plus prévisible et facilite le responsive design.

La propriété color définit la couleur du texte.

Formats de couleur CSS

/* Mots-clés */
p { color: red; }
p { color: rebeccapurple; }

/* Hexadécimal */
p { color: #ff0000; } /* Rouge */
p { color: #f00; } /* Raccourci */

/* RGB */
p { color: rgb(255, 0, 0); }

/* RGBA (avec transparence) */
p { color: rgba(255, 0, 0, 0.5); }

/* HSL */
p { color: hsl(0, 100{4a00f6d73ff9e2f537053b7c202ea3e7e3a1709f4630047a1912e510d35e71a5}, 50{4a00f6d73ff9e2f537053b7c202ea3e7e3a1709f4630047a1912e510d35e71a5}); }

/* HSLA */
p { color: hsla(0, 100{4a00f6d73ff9e2f537053b7c202ea3e7e3a1709f4630047a1912e510d35e71a5}, 50{4a00f6d73ff9e2f537053b7c202ea3e7e3a1709f4630047a1912e510d35e71a5}, 0.5); }

Practical example

body {
color: #333; /* Gris foncé - meilleure lisibilité que noir pur */
}

a {
color: #0066cc; /* Bleu pour les liens */
}

.error {
color: #cc0000; /* Rouge pour les erreurs */
}

.success {
color: #008800; /* Vert pour le succès */
}

font-style : Italique

p {
font-style: normal; /* Par défaut */
font-style: italic; /* Italique */
font-style: oblique; /* Incliné artificiellement */
}

font-weight : Graisse

p {
font-weight: normal; /* 400 */
font-weight: bold; /* 700 */
font-weight: lighter; /* Plus léger que parent */
font-weight: bolder; /* Plus gras que parent */
font-weight: 100; /* Ultra-léger */
font-weight: 900; /* Ultra-gras */
}

text-transform : Casse

p {
text-transform: none; /* Pas de transformation */
text-transform: uppercase; /* MAJUSCULES */
text-transform: lowercase; /* minuscules */
text-transform: capitalize; /* Première Lettre */
}

text-decoration : Décorations

a {
text-decoration: none; /* Aucune */
text-decoration: underline; /* Souligné */
text-decoration: overline; /* Ligne au-dessus */
text-decoration: line-through; /* Barré */
}

/* Style avancé */
a {
text-decoration: underline wavy red;
}

La propriété text-shadow ajoute des ombres au texte.

Syntax

text-shadow: décalage-x décalage-y flou couleur;

Exemple simple

h1 {
text-shadow: 4px 4px 5px rgba(0, 0, 0, 0.5);
}

Paramètres :

  • 4px : Décalage horizontal (positif = droite)
  • 4px : Décalage vertical (positif = bas)
  • 5px : Rayon de flou
  • rgba(...) : Couleur de l’ombre

Ombres multiples

h1 {
text-shadow:
-1px -1px 1px #aaa,
0px 4px 1px rgba(0, 0, 0, 0.5),
4px 4px 5px rgba(0, 0, 0, 0.7),
0px 0px 7px rgba(0, 0, 0, 0.4);
}

Effets créatifs

/* Effet néon */
.neon {
color: #fff;
text-shadow:
0 0 5px #fff,
0 0 10px #fff,
0 0 20px #0ff,
0 0 30px #0ff;
}

/* Effet relief */
.emboss {
color: #ccc;
text-shadow:
-1px -1px 0 #fff,
1px 1px 0 #333;
}

text-align : Alignement horizontal

p {
text-align: left; /* Gauche (défaut) */
text-align: right; /* Droite */
text-align: center; /* Centré */
text-align: justify; /* Justifié */
}

line-height : Hauteur de ligne

p {
line-height: 1.5; /* 1.5x la taille de police */
line-height: 24px; /* Valeur fixe */
line-height: 150{4a00f6d73ff9e2f537053b7c202ea3e7e3a1709f4630047a1912e510d35e71a5}; /* Pourcentage */
}

💡 Recommandation : Une hauteur de ligne entre 1.5 et 2 améliore significativement la lisibilité.

letter-spacing et word-spacing

p {
letter-spacing: 2px; /* Espace entre lettres */
word-spacing: 4px; /* Espace entre mots */
}

/* Premier vers - style spécial */
p::first-line {
letter-spacing: 2px;
word-spacing: 4px;
}

text-indent : Indentation

p {
text-indent: 2em; /* Retrait de la première ligne */
}

La propriété font permet de combiner plusieurs propriétés en une seule ligne.

Syntax

font: [style] [variant] [weight] [stretch] size[/line-height] family;

Examples

/* Complet */
body {
font: italic normal bold normal 16px/1.5 Helvetica, Arial, sans-serif;
}

/* Minimum requis (size + family) */
p {
font: 16px Arial;
}

/* Avec line-height */
h1 {
font: bold 2em/1.2 Georgia, serif;
}

⚠️ Attention : font-size And font-family sont obligatoires. Les propriétés omises seront réinitialisées à leur valeur par défaut.

Équivalent en propriétés séparées

/* Version raccourcie */
font: italic bold 16px/1.5 Arial, sans-serif;

/* Équivalent développé */
font-style: italic;
font-variant: normal;
font-weight: bold;
font-stretch: normal;
font-size: 16px;
line-height: 1.5;
font-family: Arial, sans-serif;

HTML


<h1>Le Guide Ultime de la Typographie Web</h1>
<p class="meta">Par Jean Dupont | 15 janvier 2024</p>
<p class="intro">
La typographie est l'art de rendre le texte non seulement lisible,
mais aussi attrayant et expressif.


<h2>Pourquoi la typographie compte</h2>


Une bonne typographie améliore la <strong>lisibilité</strong>,
renforce l'<em>identité visuelle</em> et guide le lecteur.


</article>

Full CSS

/* Base */
html {
font-size: 10px;
}

body {
font-family: 'Georgia', serif;
color: #333;
line-height: 1.6;
max-width: 800px;
margin: 0 auto;
padding: 2rem;
}

/* Titres */
h1 {
font-size: 3.2rem;
font-weight: bold;
line-height: 1.2;
color: #1a1a1a;
text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
margin-bottom: 0.5rem;
}

h2 {
font-size: 2.4rem;
font-weight: normal;
color: #444;
border-bottom: 2px solid #eee;
padding-bottom: 0.5rem;
}

/* Métadonnées */
.meta {
font-size: 1.2rem;
color: #888;
font-style: italic;
text-transform: uppercase;
letter-spacing: 1px;
}

/* Introduction */
.intro {
font-size: 1.8rem;
font-weight: 300;
color: #555;
border-left: 4px solid #0066cc;
padding-left: 1.5rem;
margin: 2rem 0;
}

/* Paragraphs */
p {
font-size: 1.6rem;
margin-bottom: 1.5rem;
}

strong {
font-weight: bold;
color: #000;
}

em {
font-style: italic;
color: #0066cc;
}

✅ Résultat : Un article élégant avec une hiérarchie visuelle claire, une excellente lisibilité et une identité typographique professionnelle.
Loading quiz...
Categories: CSS font-family Polices text-shadow Texte Typography

Post navigation

❮ Previous Post: CSS Selectors: A Complete Guide to Targeting Your Elements
Next Post: HTML Structure: Essential Tags for Your Web Pages ❯

See also

Module 1 — Technical Fundamentals of the Web
CSS Selectors: A Complete Guide to Targeting Your Elements
January 6, 2026
Module 1 — Technical Fundamentals of the Web
Advanced CSS: View Transitions, Text Effects and What's New in 2026
January 6, 2026

LMS Pro LMS Pro is an educational platform dedicated to Professional Training. LMS Pro 2026 All rights reserved

You must log in

Forgot password?
No account yet., click here
LMS Pro

Create an account

Fill in this information

Already have an account? Log in
LMS Pro
English
French