980162 vues

CSS

Sébastien Merour
publié le 13/06/2020 à 16h15 | modifé le 13/06/2020 à 19h00
Catégorie : LangagesCommentaires (5128)
CSS
Description

Le CSS (Cascading Styles Sheets) est un langage informatique permettant de décrire le style, la présentation d'un document HTML. Là où le HTML va se contenter de structurer un document, le CSS va prendre en charge le style, la mise en page d'une page web.

En réalité, le HTML n'a jamais eu besoin du langage CSS pour être exécuté sur un navigateur web. Cependant, le CSS est devenu rapidement une nécessité afin de séparer ce qui relève purement et simplement de la structure d'une page web (c'est le rôle du HTML), de ce qui relève de la mie en page (formes, couleurs, polices de caractères....).

Le style d'une page web peut être défini de 3 façons :

-soit directement dans la page HTML (avec par exemple la balise style, située dans la partie HEAD de la page)

-soit en mode inline (exemple : utilisation de la balise strong pour mettre en gras un texte)

-soit grâce à un fichier CSS, référencé dans la section HEAD de la page.

Il est évident qu'il est préférable d'utiliser la 3ème méthode. En effet : imaginons qu'un développeur souhaite modifier complètement le design d'un site web, sans pour autant modifier la structure des pages web. C'est là que le fichier CSS a son intérêt : le développeur pourra modifier le style du site en ne modifiant que le fichier CSS du site. Ce sera d'autant plus utile si le site web contient de très nombreuses pages.

Il est possible également qu'une page web ou qu'un site fasse appel à plusieurs fichiers CSS. Par exemple, il est fréquent de voir un fichier CSS différent pour chaque taille d'écran, afin de rendre un site 100% responsive.

Par ailleurs, le CSS est devenu de plus en plus puissant au fil des années. Désormais, le CSS permet d'afficher par exemple des animations, ou des graphiques particulièrement complexes.

Les sélecteurs

Le principe du CSS repose sur la sélection : on sélecte un élément (par exemple un type de balise, ou bien une balise possédant un identifiant) pour lui appliquer un style. On pourra par exemple appliquer une couleur rouge pour tous les titres de type H3.

Box Model

Tous les élements HTML (une image, un paragraphe, un formulaire...) peut être considéré comme une boîte. Pour définir cette boîte, on utilise 4 élements :

- Margin (Marge - l'espace qui est en dehors de la bordure)

- Border (Bordure - la bordure qui est autour du padding)

- Padding (Ecart - l'écart entre le contenu et la bordure)

- Content (Contenu - par exemple le texte et les images)

Grid

Grid est un principe CSS permettant d'afficher un Layout en mode "grille". Le développeur peut utiliser ce principe pour positionner des éléments dans une grille, en faisant varier par exemple la taille de chaque case, ou l'orientation de chaque rangée, etc...

Pour afficher un layout en mode Grid, il est nécessaire d'insérer l'instruction display: grid

Flexbox

Auparavant, nous avions 4 formats de Layouts possibles :

- Block, pour les sections d'une page

- Inline, pour le texte

- Table, pour afficher un tableau

- Positioned, pour positionner explicitement un élément.

L'arrivée du concept du Flexbox facilite la création de layout, sans avoir à utiliser les notions de float ou de position.

Pour activer la notion de flexbox sur un élément, il est nécessaire d'appliquer un affichage flex avec l'instruction display: flex

Les proprités d'un conteneur Flex sont les suivantes :

flex-direction

flex-wrap

flex-flow

justify-content

align-items

align-content

Fonctionnalités
Style / Mise en page
Date de création
17/12/1996
Créateur
W3C
Dernière version
3
Langage
CSS
Liens
Aux dernières nouvelles
Depuis 2010, CSS est censé évoluer vers sa version 4. Mais suite au succès de HTML 5 couplé avec CSS 3, il est possible que CSS 4 ne voit jamais le jour, où bien que la notion de version (5 pour HTML et 3 pour CSS) disparaisse, pour devenir des langages en constante évolution.

5128 Commentaire(s)
  1. user
    luxury car rental miami_qrsr
    20/06/2026 à 02h21  commentaire modifé
    Alright, last one I swear — but someone's gotta warn people about this Miami rental mess. You spot this killer offer online — brand new Porsche, zero excess, price that screams "book me". Different car waiting — dents everywhere, smells like cheap air freshener covering something worse, and that "killer price"? Doesn't include the mandatory $55 daily toll pass or the $450 "convenience fee" they invent at checkout. Fool me twenty times? That's just called Tuesday in the 305. those people are professional scammers with nice smiles and better shoes. anyone who's tried public transport here knows I'm not joking. leather seats that won't weld to your legs in July. I've tested so many rental companies across Dade, Broward, and Palm Beach. no games, no bait-and-switch, no hidden fees on page 8. prices change hourly so don't wait around: lambo truck rental lambo truck rental Yeah parking in South Beach will cost you a nice bottle of wine — but that's the Miami tax. Anyway glad there's at least one honest operator left in this town.

  2. user
    luxury car rental miami_hikn
    20/06/2026 à 02h09  commentaire modifé
    Okay real talk — Miami rentals are a minefield and someone needs to say it. Then you actually go to pick it up. Completely different car waiting — bald tires, smell like someone lived in it, and that "fair rate"? Doesn't include the mandatory $45 daily toll pass or the $350 "location fee" they spring on you. Fool me eighteen times? That's just the 305 way of life. miami car rental luxury — run away from the airport counters. anyone who's tried the trolley knows the struggle. South Beach night out, Design District shopping, or a spontaneous Keys trip — AC must be arctic and unlimited miles non-negotiable. most are polished turds with fake reviews. Finally found one outfit that doesn't play games. Here's the only honest source for premium rides across South Florida luxury car hire near me https://luxury-car-rental-miami-18.com Yeah parking in Wynwood will cost you — but that's Miami for you. drive safe and skip that "windshield protection" upsell.

  3. user
    luxury car rental miami_baml
    20/06/2026 à 02h09  commentaire modifé
    Swear this city never fails to surprise me with new ways to get ripped off. Then you actually drive to the rental lot. Plus they put a $5000 hold on your card and tell you "it's just standard procedure". Fool me thirteen times? That's just living in the 305. miami luxury car rental. Miami without proper wheels is basically a nightmare. leather seats that won't fuse to your skin in the August heat. I've tested maybe 70 rental companies across Dade, Broward, and Palm Beach. Finally found one outfit that actually delivers what's promised. Here's the only straight shooter for premium rides across South Florida rent a benz near me https://luxury-car-rental-miami-13.com also bring polarized shades unless you enjoy driving into the sun like a blind bat every evening. Anyway glad there's at least one honest rental joint left in this town.

  4. user
    luxury car rental miami_eqml
    20/06/2026 à 02h06  commentaire modifé
    Swear this city never fails to surprise me with new ways to get ripped off. You see this killer deal online — brand new Mercedes, unlimited miles, price that makes you want to book immediately. Completely different car sitting there — scratches everywhere, smells like someone hotboxed it for a week, and that "killer price"? Doesn't include the mandatory $45 daily insurance or the $400 "destination fee" they add at the very end. Fool me thirteen times? That's just living in the 305. those people are professional con artists with nice uniforms. Miami without proper wheels is basically a nightmare. South Beach night out, Design District shopping spree, or a spontaneous Keys trip — AC must be arctic cold and unlimited miles non-negotiable. most are polished garbage with fake five-star reviews bought from some shady service. no games, no bait-and-switch, no hidden fees buried on page 4 of the contract. Here's the only straight shooter for premium rides across South Florida rent cadillac escalade near me https://luxury-car-rental-miami-13.com Yeah parking in Wynwood will cost you a nice dinner — but that's just the Miami tax. Anyway glad there's at least one honest rental joint left in this town.

  5. user
    luxury car rental miami_pyml
    20/06/2026 à 02h04  commentaire modifé
    Okay folks gather round — another Miami rental horror story coming at you. You see this killer deal online — brand new Mercedes, unlimited miles, price that makes you want to book immediately. Completely different car sitting there — scratches everywhere, smells like someone hotboxed it for a week, and that "killer price"? Doesn't include the mandatory $45 daily insurance or the $400 "destination fee" they add at the very end. Thirteen years in South Florida and these clowns still almost get me. luxury car for rent. anyone who's taken the Metro here knows the struggle is real. South Beach night out, Design District shopping spree, or a spontaneous Keys trip — AC must be arctic cold and unlimited miles non-negotiable. most are polished garbage with fake five-star reviews bought from some shady service. no games, no bait-and-switch, no hidden fees buried on page 4 of the contract. Here's the only straight shooter for premium rides across South Florida cadillac escalade for rent near me https://luxury-car-rental-miami-13.com Yeah parking in Wynwood will cost you a nice dinner — but that's just the Miami tax. drive safe and definitely skip that "tire protection" upsell — pure robbery.

Ajoutez un commentaire :