226568 vues

CSS

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

2218 Commentaire(s)
  1. user
    MichaelGOP
    21/02/2025 à 17h10  commentaire modifé
    Guatemala has pledged a 40% increase in deportation flights carrying Guatemalans and migrants of other nationalities from the United States, President Bernardo Arevalo announced Wednesday during a press conference with US Secretary of State Marco Rubio. kra50 at Guatemala has also agreed to create a task force for border control and protection along the country’s eastern borders. The force, composed of members of the National Police and army, will be tasked with fighting “all forms of transnational crime,” Arevalo said. kra49 at Foreign nationals who arrive in Guatemala through deportation flights will be repatriated to their home countries, Arevalo said, adding that the US and Guatemala would continue to have talks on how the process would work and how the US would cooperate. kra31.at Arevalo also said that Rubio has voiced his support for developing infrastructure projects in the Central American nation. He added that his government would send a delegation to Washington in the coming weeks to negotiate deals for economic investments in Guatemala – which he said would incentivize Guatemalans to stay in their home country and not migrate to the US. Arevalo said Guatemala has not had any discussions about receiving criminals from the US as El Salvador’s president has offered. He also insisted his country has not reached a “safe third country” agreement with the United States, which would require migrants who pass through Guatemala to apply for asylum there rather than continuing to the US. kra46 cc https://kra-36-at.com

  2. user
    Anthonyvem
    21/02/2025 à 17h04  commentaire modifé
    Аренда жилой недвижимости https://domhata.ru без посредников и переплат! Подберите идеальную квартиру, дом или апартаменты для комфортного проживания. Удобный поиск по цене, району и условиям.

  3. user
    MichaelGOP
    21/02/2025 à 16h52  commentaire modifé
    Guatemala has pledged a 40% increase in deportation flights carrying Guatemalans and migrants of other nationalities from the United States, President Bernardo Arevalo announced Wednesday during a press conference with US Secretary of State Marco Rubio. ссылка на сайт кракен Guatemala has also agreed to create a task force for border control and protection along the country’s eastern borders. The force, composed of members of the National Police and army, will be tasked with fighting “all forms of transnational crime,” Arevalo said. kra40 cc Foreign nationals who arrive in Guatemala through deportation flights will be repatriated to their home countries, Arevalo said, adding that the US and Guatemala would continue to have talks on how the process would work and how the US would cooperate. кракен рабочий сайт Arevalo also said that Rubio has voiced his support for developing infrastructure projects in the Central American nation. He added that his government would send a delegation to Washington in the coming weeks to negotiate deals for economic investments in Guatemala – which he said would incentivize Guatemalans to stay in their home country and not migrate to the US. Arevalo said Guatemala has not had any discussions about receiving criminals from the US as El Salvador’s president has offered. He also insisted his country has not reached a “safe third country” agreement with the United States, which would require migrants who pass through Guatemala to apply for asylum there rather than continuing to the US. кракен сайт зеркало рабочее https://kra33-at.cc

  4. user
    MichaelGOP
    21/02/2025 à 15h29  commentaire modifé
    Guatemala has pledged a 40% increase in deportation flights carrying Guatemalans and migrants of other nationalities from the United States, President Bernardo Arevalo announced Wednesday during a press conference with US Secretary of State Marco Rubio. kra49 cc Guatemala has also agreed to create a task force for border control and protection along the country’s eastern borders. The force, composed of members of the National Police and army, will be tasked with fighting “all forms of transnational crime,” Arevalo said. ссылка на сайт кракен Foreign nationals who arrive in Guatemala through deportation flights will be repatriated to their home countries, Arevalo said, adding that the US and Guatemala would continue to have talks on how the process would work and how the US would cooperate. kra47 cc Arevalo also said that Rubio has voiced his support for developing infrastructure projects in the Central American nation. He added that his government would send a delegation to Washington in the coming weeks to negotiate deals for economic investments in Guatemala – which he said would incentivize Guatemalans to stay in their home country and not migrate to the US. Arevalo said Guatemala has not had any discussions about receiving criminals from the US as El Salvador’s president has offered. He also insisted his country has not reached a “safe third country” agreement with the United States, which would require migrants who pass through Guatemala to apply for asylum there rather than continuing to the US. kra40.cc https://kra33at.cc

  5. user
    Sykaaamaw
    21/02/2025 à 12h52  commentaire modifé
    Привет игроки в казино! Вывод средств осуществляется быстро и без задержек, обеспечивая игрокам комфортный игровой процесс. В Сукааа Казино минимальная сумма вывода составляет 1000 рублей, а средства поступают на счет в течение 10 минут – 24 часов. Sykaaa Casino вывод доступен через все популярные платежные системы, а скорость обработки зависит от выбранного метода.Круглосуточная служба поддержки всегда готова помочь игрокам с любыми вопросами. В Сукааа Казино специалисты доступны 24/7 через онлайн-чат, электронную почту и горячую линию. Sykaaa Casino служба поддержки оперативно отвечает на запросы, помогая решать любые сложности. Заходите по ссылке - Sykaaa casino мобильная версия Сукааа воспользуйтесь всеми преимуществами программ лояльности, Sykaaa casino онлайн официальный, Sykaaa официальное зеркало Хороших джекпотов!

Ajoutez un commentaire :