566004 vues

CSS

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

12927 Commentaire(s)
  1. user
    nighthearten8vax
    29/10/2025 à 16h44  commentaire modifé
    Ich schatze die Energie bei Cat Spins Casino, es sorgt fur pure Unterhaltung. Die Spiele sind abwechslungsreich und spannend, mit Krypto-freundlichen Titeln. Er steigert das Spielvergnugen sofort. Der Support ist professionell und schnell. Gewinne kommen ohne Verzogerung, dennoch mehr Bonusvarianten waren ein Hit. Am Ende, Cat Spins Casino ist ein Top-Ziel fur Spieler. Nebenbei die Plattform ist optisch ein Highlight, das Vergnugen maximiert. Ein starker Vorteil die lebendigen Community-Events, die die Community enger zusammenschwei?en. Weiter gehen|

  2. user
    criskis7vax
    29/10/2025 à 16h42  commentaire modifé
    J’apprecie enormement 7BitCasino, ca procure une plongee dans un univers palpitant. La selection de jeux est colossale, proposant des jeux de table elegants et classiques. Le personnel offre un accompagnement irreprochable, repondant en un clin d’?il. Le processus de retrait est simple et fiable, neanmoins les bonus pourraient etre plus reguliers, afin de maximiser l’experience. En resume, 7BitCasino vaut pleinement le detour pour ceux qui aiment parier avec des cryptomonnaies ! Ajoutons que le site est concu avec style et modernite, renforce l’immersion totale. 7bitcasino no deposit bonus codes 2020|

  3. user
    GeraldJak
    29/10/2025 à 15h21  commentaire modifé
    У Кума https://u-kuma.com мужской блог об авто, спорте, армии, рыбалке. Тысячи статей на мужские темы

  4. user
    JavierMog
    29/10/2025 à 13h02  commentaire modifé
    ?Elevemos nuestras copas por cada experto en la suerte! https://wikiluck.com.es/review/ - http://wikiluck.com.es/review/# ?Que la fortuna te acompane con celebremos juntos increibles victorias legendarias! п»їhttps://wikiluck.com.es/review

  5. user
    wedding_eqSi
    29/10/2025 à 12h49  commentaire modifé
    When designing wedding invitations, many couples use personalized wedding invitation stamps, to add personality and flair to your special invitations. Using wedding stamps is a great way to add a personal touch to wedding invitations and other wedding-related documents. They come in a variety of designs and styles, from traditional to modern Wedding stamps can be found in many different designs and styles, from traditional to modern . Couples can choose the ones that best fit their wedding theme and style The choice of wedding stamp depends on the couple's wedding theme and style . Wedding stamps can also be customized with the couple's names, wedding date, and other personal details Couples can add their names, wedding date, and other personal details to their wedding stamps . Wedding stamps are not only beautiful but also meaningful The beauty of wedding stamps is matched by their significance. They symbolize the union of two people and the beginning of their new life together Wedding stamps represent the union of two individuals and the start of their new life together . Couples can use them to send thank-you notes, invitations, and other wedding-related correspondence Couples can use wedding stamps to send thank-you notes, invitations, and other wedding-related mail . Wedding stamps can also be collected as a keepsake Wedding stamps can be kept as a memento . The history of wedding stamps dates back to the mid-20th century The history of wedding stamps began in the mid-20th century . The first wedding stamps were introduced by the United States Postal Service The first wedding stamps were issued by the US Postal Service . They were designed to commemorate special occasions such as weddings and anniversaries These stamps were designed to commemorate special occasions like weddings and anniversaries . Since then, wedding stamps have become a popular way to celebrate weddings Wedding stamps have become a popular way to celebrate weddings . The designs of wedding stamps have evolved over the years The designs of wedding stamps have developed over time. From traditional to modern, there are many different designs to choose from Couples can choose from a variety of designs, including traditional, modern, and vintage . Some wedding stamps feature romantic landscapes, while others feature beautiful floral arrangements Some wedding stamps have romantic landscapes, while others have beautiful flowers. Couples can choose the ones that best fit their wedding theme and style Couples can choose the wedding stamps that best fit their wedding theme and style . There are many different types of wedding stamps available There are various types of wedding stamps available. Some are designed specifically for wedding invitations, while others are designed for thank-you notes and other correspondence Some wedding stamps are designed specifically for wedding invitations, while others are designed for thank-you notes and other mail . Couples can also choose from a variety of shapes and sizes Wedding stamps come in many different shapes and sizes . Some wedding stamps are heart-shaped, while others are square or circular Some wedding stamps are heart-shaped, while others are square or round. Wedding stamps can also be customized with the couple's names, wedding date, and other personal details Wedding stamps can be personalized with the couple's names, wedding date, and other personal information . This makes them a unique and meaningful way to commemorate the wedding Customizing wedding stamps with personal details makes them a unique and meaningful way to celebrate the wedding . Couples can use them to send invitations, thank-you notes, and other wedding-related correspondence Couples can use wedding stamps to send invitations, thank-you notes, and other wedding-related mail . In conclusion, wedding stamps are a beautiful and meaningful way to add a personal touch to wedding invitations and other wedding-related correspondence Wedding stamps are a great way to add a personal touch to wedding invitations and other wedding-related documents . They come in a variety of designs and styles, and can be customized with the couple's names, wedding date, and other personal details Wedding stamps can be found in many different designs and styles, and can be customized with personal details . Couples can use them to send invitations, thank-you notes, and other wedding-related correspondence Couples can use wedding stamps to send invitations, thank-you notes, and other wedding-related mail . Wedding stamps are a unique and meaningful way to commemorate the wedding Customizing wedding stamps with personal details makes them a unique and meaningful way to celebrate the wedding . Overall, wedding stamps are a wonderful way to make the wedding planning process more special and meaningful Overall, wedding stamps are a great way to make the wedding planning process more special and meaningful . They can be used in many different ways, from sending invitations to decorating the wedding album Wedding stamps can be used in various ways, including sending invitations and creating a special wedding keepsake. Couples can choose the wedding stamps that best fit their wedding theme and style Couples can pick the wedding stamps that fit their wedding theme and style. By using wedding stamps, couples can add a personal touch to their wedding and make it even more special and memorable By using wedding stamps, couples can add a personal touch to their wedding and make it even more special and memorable .

Ajoutez un commentaire :