Add some style · Ajoutez du style
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Cette page nécessite un navigateur récent (avec support SharedArrayBuffer). Veuillez mettre à jour Chrome, Edge, Firefox ou Safari vers la dernière version.
English
Adding style
- HTML gives your page its content. CSS makes it look good.
- The easiest way to add CSS is a
<style>block near the top of your page. - Inside it, you write rules that change how things look.
Français
Ajouter du style
- HTML fournit le contenu de votre page. CSS rend l'apparence belle.
- Le moyen le plus facile d'ajouter du CSS est un bloc
<style>près du haut de votre page. - À l'intérieur, vous écrivez des règles qui changent l'apparence des éléments.
English
A CSS rule
- A rule has three parts:
p { color: blue; } pis the selector — which tags to change (here, every paragraph).coloris the property — what to change.blueis the value — what to change it to. (Together,color: blue;is one declaration.)
Français
Une règle CSS
- Une règle a trois parties :
p { color: blue; } pest le sélecteur — quelles balises changer (ici, chaque paragraphe).colorest la propriété — quoi changer.blueest la valeur — ce à quoi le changer. (Ensemble,color: blue;est une déclaration.)
<style>
p { color: blue; }
</style>
<p>Now I am blue.</p>
<p>So am I!</p>
English
Common mistakes
- Link the CSS file, or put rules inside a
<style>block. - Each CSS rule ends with a semicolon
;.
Français
Erreurs courantes
- Liez le fichier CSS, ou placez les règles à l'intérieur d'un bloc
<style>. - Chaque règle CSS se termine par un point-virgule
;.
English
Now you try
- Write your rules inside the
<style>block. - Colour your paragraphs, then your heading.
Français
À vous maintenant
- Écrivez vos règles à l'intérieur du bloc
<style>. - Coloriez vos paragraphes, puis votre titre.
Make every paragraph blue · bleue. Inside the <style> block, add the rule p { color: blue; }. · Rendez chaque paragraphe bleu. À l'intérieur du bloc <style>, ajoutez la règle p { color: blue; }.
Now colour the heading too. Add a rule h1 { color: red; }. · Maintenant colorez aussi le titre. Ajoutez une règle h1 { color: red; }.