644429 vues

CSS

Sébastien Merour
publié le 13/06/2020 à 16h15 | modifé le 13/06/2020 à 19h00
Catégorie : LangagesCommentaires (15139)
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.

15139 Commentaire(s)
  1. user
    mostbet_uePa
    02/09/2025 à 14h46  commentaire modifé
    mostbet скачать на андроид http://mostbet4122.ru

  2. user
    Smart DNS
    02/09/2025 à 14h15  commentaire modifé
    Smart DNS SmartStreaming.TV: the smart method to access your preferred content wherever you are Nowadays, we consume series, films and audio from almost any device: computers, Smart TVs, video game systems, media players and even smartphones. However, anyone who has left their country knows how unpleasant it can be to stay at a hotel or an airport and discover that the catalog we enjoy at home is not available in another country. This is where SmartStreaming.TV proves its value, a platform designed to make your entertainment always be with you. How does SmartStreaming.TV work? Streaming platforms recognize your place through the IP address of your device. This means that, depending on the country you are in, you may have permission to view (or restrictions) to certain collections of movies, shows or live broadcasts. The proposal of SmartStreaming.TV is simple but functional: the system protects your real location and gives you an IP address in the country where the content is available. In this way, you can enjoy your shows, films and platforms as if you were at home, no matter where you are. Fast, secure, and legal One of the most common questions when discussing this type of service is whether it is safe or legitimate. In the case of SmartStreaming.TV, the answer is definite: absolutely. The system functions through a protocol called Smart DNS, which does not keep your personal data or slow down your connection. It is quick, safe and 100% legal. In addition, unlike other technologies that are more advanced, you don’t need to use complex apps or alter your system deeply. The configuration is easy and adapted to most modern devices. Ideal for those who travel If you travel for work, do an academic stay outside or simply like visiting new places, SmartStreaming.TV proves to be an fundamental resource. You will no longer worry about missing the newest chapter of your favorite show or not being able to watch a live sporting event. In short, SmartStreaming.TV makes your entertainment really international: no matter your location, access to your content will be just one click away.

  3. user
    Smart DNS
    02/09/2025 à 13h02  commentaire modifé
    Smart DNS SmartStreaming.TV: the smart method to enjoy your favorite content anywhere Nowadays, we consume shows, motion pictures and audio from all kinds of devices: computers, Smart TVs, video game systems, streaming devices and even mobile phones. However, anyone who has traveled knows how unpleasant it can be to check into a hotel or an airport and realize that the material we watch at home is not available in another country. This is where SmartStreaming.TV proves its value, a tool designed to make your fun travel with you. How does SmartStreaming.TV work? Streaming platforms identify your position through the IP address of your device. This means that, based on your geographic location, you may have ability to use (or blocks) to certain collections of films, shows or live broadcasts. The proposal of SmartStreaming.TV is clear but effective: the system hides your real location and assigns you an IP address in the country where the content is available. In this way, you can enjoy your shows, movies and services as if you stayed at home, no matter where you are. Security, speed, and legality One of the most common questions when discussing this type of service is whether it is secure or legal. In the case of SmartStreaming.TV, the answer is straightforward: absolutely. The system works through a protocol called Smart DNS, which does not keep your personal data or slow down your connection. It is speedy, protected and 100% legal. In addition, unlike other methods that are more complicated, you don’t need to download large software or modify your device deeply. The installation is easy and adapted to most modern devices. Ideal for those who travel If you travel for work, study abroad or simply like visiting new places, SmartStreaming.TV becomes an essential partner. You will no longer stress over missing the newest chapter of your favorite show or not being able to watch a game broadcast. In short, SmartStreaming.TV makes your content really international: no matter your location, access to your entertainment will be within easy reach.

  4. user
    Smart DNS
    02/09/2025 à 12h24  commentaire modifé
    Smart DNS SmartStreaming.TV: the smart option to enjoy your preferred content anywhere Nowadays, we consume series, films and songs from all kinds of devices: computers, Smart TVs, gaming consoles, streaming devices and even mobile phones. However, anyone who has left their country knows how frustrating it can be to check into a hotel or an airport and realize that the catalog we enjoy at home is not available in another country. This is where SmartStreaming.TV proves its value, a tool created to make your content always be with you. How does SmartStreaming.TV work? Applications recognize your position through the IP of your device. This means that, depending on the country you are in, you may have access (or restrictions) to certain collections of movies, shows or real-time streams. The proposal of SmartStreaming.TV is clear but functional: the system masks your real location and assigns you an IP address in the country where the catalog is available. In this way, you can enter your series, movies and services as if you were at home, no matter your current location. Fast, secure, and legal One of the most common questions when discussing this type of service is whether it is safe or valid. In the case of SmartStreaming.TV, the answer is clear: yes. The system functions through a protocol called Smart DNS, which does not keep your personal data or affect your connection. It is fast, safe and 100% legal. In addition, unlike other solutions that are more complex, you don’t need to use complex apps or modify your computer deeply. The setup is simple and works on most modern devices. Made for globetrotters If you go abroad for business, study abroad or simply like visiting new places, SmartStreaming.TV turns into an indispensable ally. You will no longer fear missing the newest chapter of your favorite show or not being able to watch a game broadcast. In short, SmartStreaming.TV makes your entertainment authentically worldwide: wherever you go, access to your entertainment will be instantly available.

  5. user
    eclat-119
    02/09/2025 à 10h53  commentaire modifé
    Комплексные IT-решения https://eclat.moscow для бизнеса: разработка, внедрение, сопровождение и поддержка. Надежные технологии для автоматизации и цифровой трансформации.

Ajoutez un commentaire :