2248857 vues

CSS

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

59240 Commentaire(s)
  1. user
    CurtisWak
    25/11/2026 à 13h20  commentaire modifé
    Эта публикация посвящена актуальным вопросам современной медицины и здравоохранения. Мы обсудим новейшие технологии диагностики и лечения, а также их влияние на продолжительность и качество жизни. Читатель найдет здесь информацию о научных исследованиях и перспективных разработках, доступно изложенную для широкой аудитории. Проследить причинно-следственные связи - наркологический центр здоровья в самаре

  2. user
    online tool
    25/11/2026 à 08h27  commentaire modifé
    online tool Why Simple Online Tools Still Matter in 2026 Modern software is becoming increasingly complex. Applications that once performed a single task now include subscriptions, cloud accounts, collaboration features, and complicated interfaces. But sometimes all you need is a quick way to format text, convert data, or edit an image. That's where browser-based utilities become useful. Instead of downloading and installing separate applications, users can open a website, select a tool, and complete their task directly in the browser. This approach is particularly convenient for occasional jobs that don't justify installing additional software. One example is (https://mytooldeck.online/), an online collection of utilities organized into categories such as text processing, developer tools, images, documents, and productivity. The platform focuses on clear interfaces and straightforward workflows. Its catalog also distinguishes available tools from utilities still in development, helping visitors identify what they can use. Browser-based tools won't replace every desktop application, especially for demanding professional work. However, for everyday tasks, they offer an appealing combination of accessibility, convenience, and simplicity. Sometimes the most useful software is the software you don't need to install. === How to Optimize Images Without Installing Editing Software Images play an important role in websites, online stores, blogs, and social media. Unfortunately, large image files can slow down page loading, consume storage space, and make content harder to share. Reducing image size is often a simple way to improve everyday workflows. For many common tasks, a full-featured photo editor is unnecessary. A dedicated online utility can handle compression or resizing without requiring software installation. The Compressor on Tooldeck](https://mytooldeck.online/image/image-compressor/) offers browser-based image processing with adjustable settings and output previews. Users can work with common image formats and compare file sizes before saving the result. Browser-based processing also provides a practical advantage: images can be processed locally without uploading them to a remote processing service. However, compression requires some care. Reducing file size may affect visual quality, metadata, or color information. It's worth keeping the original image and checking the compressed result before publishing it. Whether you're maintaining a blog, preparing product photographs, or optimizing website assets, lightweight image utilities can save time and simplify repetitive tasks. === JSON Formatting: A Small Tool That Makes Development Easier JSON is widely used in web applications, APIs, configuration files, and data exchange. Its lightweight structure makes it convenient for computers, but reading large blocks of compressed JSON can be frustrating for developers. A JSON formatter solves this problem by converting compact data into an organized, readable structure. Proper indentation makes nested objects and arrays easier to understand. It also helps developers inspect API responses, review configuration files, and identify structural problems more quickly. For developers who need a quick formatting workspace, s JSON Formatter](https://mytooldeck.online/data/json-formatter/) provides an online interface with adjustable indentation, optional key sorting, and options to copy or download formatted results. The tool processes input locally in the browser, without sending it to a separate processing service. One important distinction is that formatting does not repair invalid JSON automatically. Input must follow JSON syntax rules, and developers should be careful when handling extremely large numbers that may exceed JavaScript's safe integer range.

  3. user
    online tool
    25/11/2026 à 08h15  commentaire modifé
    online tool Why Simple Online Tools Still Matter in 2026 Modern software is becoming increasingly complex. Applications that once performed a single task now include subscriptions, cloud accounts, collaboration features, and complicated interfaces. But sometimes all you need is a quick way to format text, convert data, or edit an image. That's where browser-based utilities become useful. Instead of downloading and installing separate applications, users can open a website, select a tool, and complete their task directly in the browser. This approach is particularly convenient for occasional jobs that don't justify installing additional software. One example is (https://mytooldeck.online/), an online collection of utilities organized into categories such as text processing, developer tools, images, documents, and productivity. The platform focuses on clear interfaces and straightforward workflows. Its catalog also distinguishes available tools from utilities still in development, helping visitors identify what they can use. Browser-based tools won't replace every desktop application, especially for demanding professional work. However, for everyday tasks, they offer an appealing combination of accessibility, convenience, and simplicity. Sometimes the most useful software is the software you don't need to install. === How to Optimize Images Without Installing Editing Software Images play an important role in websites, online stores, blogs, and social media. Unfortunately, large image files can slow down page loading, consume storage space, and make content harder to share. Reducing image size is often a simple way to improve everyday workflows. For many common tasks, a full-featured photo editor is unnecessary. A dedicated online utility can handle compression or resizing without requiring software installation. The Compressor on Tooldeck](https://mytooldeck.online/image/image-compressor/) offers browser-based image processing with adjustable settings and output previews. Users can work with common image formats and compare file sizes before saving the result. Browser-based processing also provides a practical advantage: images can be processed locally without uploading them to a remote processing service. However, compression requires some care. Reducing file size may affect visual quality, metadata, or color information. It's worth keeping the original image and checking the compressed result before publishing it. Whether you're maintaining a blog, preparing product photographs, or optimizing website assets, lightweight image utilities can save time and simplify repetitive tasks. === JSON Formatting: A Small Tool That Makes Development Easier JSON is widely used in web applications, APIs, configuration files, and data exchange. Its lightweight structure makes it convenient for computers, but reading large blocks of compressed JSON can be frustrating for developers. A JSON formatter solves this problem by converting compact data into an organized, readable structure. Proper indentation makes nested objects and arrays easier to understand. It also helps developers inspect API responses, review configuration files, and identify structural problems more quickly. For developers who need a quick formatting workspace, s JSON Formatter](https://mytooldeck.online/data/json-formatter/) provides an online interface with adjustable indentation, optional key sorting, and options to copy or download formatted results. The tool processes input locally in the browser, without sending it to a separate processing service. One important distinction is that formatting does not repair invalid JSON automatically. Input must follow JSON syntax rules, and developers should be careful when handling extremely large numbers that may exceed JavaScript's safe integer range.

  4. user
    online tool
    25/11/2026 à 07h57  commentaire modifé
    online tool Why Simple Online Tools Still Matter in 2026 Modern software is becoming increasingly complex. Applications that once performed a single task now include subscriptions, cloud accounts, collaboration features, and complicated interfaces. But sometimes all you need is a quick way to format text, convert data, or edit an image. That's where browser-based utilities become useful. Instead of downloading and installing separate applications, users can open a website, select a tool, and complete their task directly in the browser. This approach is particularly convenient for occasional jobs that don't justify installing additional software. One example is (https://mytooldeck.online/), an online collection of utilities organized into categories such as text processing, developer tools, images, documents, and productivity. The platform focuses on clear interfaces and straightforward workflows. Its catalog also distinguishes available tools from utilities still in development, helping visitors identify what they can use. Browser-based tools won't replace every desktop application, especially for demanding professional work. However, for everyday tasks, they offer an appealing combination of accessibility, convenience, and simplicity. Sometimes the most useful software is the software you don't need to install. === How to Optimize Images Without Installing Editing Software Images play an important role in websites, online stores, blogs, and social media. Unfortunately, large image files can slow down page loading, consume storage space, and make content harder to share. Reducing image size is often a simple way to improve everyday workflows. For many common tasks, a full-featured photo editor is unnecessary. A dedicated online utility can handle compression or resizing without requiring software installation. The Compressor on Tooldeck](https://mytooldeck.online/image/image-compressor/) offers browser-based image processing with adjustable settings and output previews. Users can work with common image formats and compare file sizes before saving the result. Browser-based processing also provides a practical advantage: images can be processed locally without uploading them to a remote processing service. However, compression requires some care. Reducing file size may affect visual quality, metadata, or color information. It's worth keeping the original image and checking the compressed result before publishing it. Whether you're maintaining a blog, preparing product photographs, or optimizing website assets, lightweight image utilities can save time and simplify repetitive tasks. === JSON Formatting: A Small Tool That Makes Development Easier JSON is widely used in web applications, APIs, configuration files, and data exchange. Its lightweight structure makes it convenient for computers, but reading large blocks of compressed JSON can be frustrating for developers. A JSON formatter solves this problem by converting compact data into an organized, readable structure. Proper indentation makes nested objects and arrays easier to understand. It also helps developers inspect API responses, review configuration files, and identify structural problems more quickly. For developers who need a quick formatting workspace, s JSON Formatter](https://mytooldeck.online/data/json-formatter/) provides an online interface with adjustable indentation, optional key sorting, and options to copy or download formatted results. The tool processes input locally in the browser, without sending it to a separate processing service. One important distinction is that formatting does not repair invalid JSON automatically. Input must follow JSON syntax rules, and developers should be careful when handling extremely large numbers that may exceed JavaScript's safe integer range.

  5. user
    online tool
    25/11/2026 à 07h41  commentaire modifé
    online tool Why Simple Online Tools Still Matter in 2026 Modern software is becoming increasingly complex. Applications that once performed a single task now include subscriptions, cloud accounts, collaboration features, and complicated interfaces. But sometimes all you need is a quick way to format text, convert data, or edit an image. That's where browser-based utilities become useful. Instead of downloading and installing separate applications, users can open a website, select a tool, and complete their task directly in the browser. This approach is particularly convenient for occasional jobs that don't justify installing additional software. One example is (https://mytooldeck.online/), an online collection of utilities organized into categories such as text processing, developer tools, images, documents, and productivity. The platform focuses on clear interfaces and straightforward workflows. Its catalog also distinguishes available tools from utilities still in development, helping visitors identify what they can use. Browser-based tools won't replace every desktop application, especially for demanding professional work. However, for everyday tasks, they offer an appealing combination of accessibility, convenience, and simplicity. Sometimes the most useful software is the software you don't need to install. === How to Optimize Images Without Installing Editing Software Images play an important role in websites, online stores, blogs, and social media. Unfortunately, large image files can slow down page loading, consume storage space, and make content harder to share. Reducing image size is often a simple way to improve everyday workflows. For many common tasks, a full-featured photo editor is unnecessary. A dedicated online utility can handle compression or resizing without requiring software installation. The Compressor on Tooldeck](https://mytooldeck.online/image/image-compressor/) offers browser-based image processing with adjustable settings and output previews. Users can work with common image formats and compare file sizes before saving the result. Browser-based processing also provides a practical advantage: images can be processed locally without uploading them to a remote processing service. However, compression requires some care. Reducing file size may affect visual quality, metadata, or color information. It's worth keeping the original image and checking the compressed result before publishing it. Whether you're maintaining a blog, preparing product photographs, or optimizing website assets, lightweight image utilities can save time and simplify repetitive tasks. === JSON Formatting: A Small Tool That Makes Development Easier JSON is widely used in web applications, APIs, configuration files, and data exchange. Its lightweight structure makes it convenient for computers, but reading large blocks of compressed JSON can be frustrating for developers. A JSON formatter solves this problem by converting compact data into an organized, readable structure. Proper indentation makes nested objects and arrays easier to understand. It also helps developers inspect API responses, review configuration files, and identify structural problems more quickly. For developers who need a quick formatting workspace, s JSON Formatter](https://mytooldeck.online/data/json-formatter/) provides an online interface with adjustable indentation, optional key sorting, and options to copy or download formatted results. The tool processes input locally in the browser, without sending it to a separate processing service. One important distinction is that formatting does not repair invalid JSON automatically. Input must follow JSON syntax rules, and developers should be careful when handling extremely large numbers that may exceed JavaScript's safe integer range.

Ajoutez un commentaire :