SlideShare une entreprise Scribd logo
1  sur  5
Télécharger pour lire hors ligne
MEDIA QUERIES
LE RESPONSIVE DESIGN AVEC LES
1MACÉ ALEXIS - LES MEDIA QUERIES
QU’EST-CE QU’UNE MEDIA QUERIES ?
▸ Spécification CSS3 pour attribuer une ou plusieurs propriétés CSS uniquement
lorsque la condition spécifiée a lieu.
▸ Se créée avec @media suivie du type de l’écran et de conditions.
▸ S’intègre directement dans le fichier style.css du site. Il y a
également la possibilité de créer une feuille de style spéciale de l’appeler
depuis votre HTML :
<link rel="stylesheet" media="screen and (max-width:
votre_resolution_en_px) » href=« votre-fichier. css» />
2MACÉ ALEXIS - LES MEDIA QUERIES
LA CONSTRUCTION DES MÉDIAS QUERIES
▸ Les principaux critères disponibles :
▸ Width : largeur dans le navigateur;
▸ Height : hauteur dans le navigateur;
▸ Device-width : largeur de l’écran de l’appareil;
▸ Device-height : hauteur de l’écran de l’appareil;
▸ Orientation : orientation de l’appareil.
▸ Ces critères peuvent être associer avec « only », « and » et « not ».
3MACÉ ALEXIS - LES MEDIA QUERIES
LA CONSTRUCTION DES MÉDIAS QUERIES
▸ Mise en pratique
▸ Si l’on ne veut pas afficher nos h2 lorsque l’écran passe en dessous
des 480px.
▸ @media all and (min-width: 480px)
{
h2{
display:none;
}
}
4MACÉ ALEXIS - LES MEDIA QUERIES
LA CONSTRUCTION DES MÉDIAS QUERIES
▸ Mise en pratique
▸ Si l’on ne veut pas afficher nos h2 lorsque les écrans sont orientés en
mode portrait.
▸ @media all and (orientation:portrait)
{
h2{
display:none;
}
}
5MACÉ ALEXIS - LES MEDIA QUERIES

Contenu connexe

En vedette

En vedette (13)

Táblagépes alkalmazások a gyógypedagógiai gyakorlatban súlyosan-halmozottan s...
Táblagépes alkalmazások a gyógypedagógiai gyakorlatban súlyosan-halmozottan s...Táblagépes alkalmazások a gyógypedagógiai gyakorlatban súlyosan-halmozottan s...
Táblagépes alkalmazások a gyógypedagógiai gyakorlatban súlyosan-halmozottan s...
 
Cds grupo207102 3_momento de reconocimiento
Cds grupo207102 3_momento de reconocimientoCds grupo207102 3_momento de reconocimiento
Cds grupo207102 3_momento de reconocimiento
 
Horror magazine production
Horror magazine productionHorror magazine production
Horror magazine production
 
1temagrado8
1temagrado81temagrado8
1temagrado8
 
開源 x 節流:企業導入實例分享 (二) [2016/03/31] 文件自由日研討會
開源 x 節流:企業導入實例分享 (二) [2016/03/31] 文件自由日研討會開源 x 節流:企業導入實例分享 (二) [2016/03/31] 文件自由日研討會
開源 x 節流:企業導入實例分享 (二) [2016/03/31] 文件自由日研討會
 
Projeto gelo
Projeto geloProjeto gelo
Projeto gelo
 
Privacy is an Illusion and you’re all losers! - Cryptocow - Infosecurity 2013
Privacy is an Illusion and you’re all losers! - Cryptocow - Infosecurity 2013Privacy is an Illusion and you’re all losers! - Cryptocow - Infosecurity 2013
Privacy is an Illusion and you’re all losers! - Cryptocow - Infosecurity 2013
 
Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020
 
Beyond the Gig Economy
Beyond the Gig EconomyBeyond the Gig Economy
Beyond the Gig Economy
 
African Americans: College Majors and Earnings
African Americans: College Majors and Earnings African Americans: College Majors and Earnings
African Americans: College Majors and Earnings
 
Shall we play a game?
Shall we play a game?Shall we play a game?
Shall we play a game?
 
Creative Traction Methodology - For Early Stage Startups
Creative Traction Methodology - For Early Stage StartupsCreative Traction Methodology - For Early Stage Startups
Creative Traction Methodology - For Early Stage Startups
 
The Online College Labor Market
The Online College Labor MarketThe Online College Labor Market
The Online College Labor Market
 

Similaire à Le responsive design avec les media queries | Alexis Macé

Similaire à Le responsive design avec les media queries | Alexis Macé (6)

WebApp #2 : responsive design
WebApp #2 : responsive designWebApp #2 : responsive design
WebApp #2 : responsive design
 
582 agr-li - interface mobile - classe 1
582   agr-li - interface mobile - classe 1582   agr-li - interface mobile - classe 1
582 agr-li - interface mobile - classe 1
 
Glossaire web pour les profanes - Webdesign
Glossaire web pour les profanes - WebdesignGlossaire web pour les profanes - Webdesign
Glossaire web pour les profanes - Webdesign
 
Plasticité2015 technovf
Plasticité2015 technovfPlasticité2015 technovf
Plasticité2015 technovf
 
Webdesign, UX et UCD #1
Webdesign, UX et UCD #1Webdesign, UX et UCD #1
Webdesign, UX et UCD #1
 
Cours de Web Design part.1
Cours de Web Design part.1Cours de Web Design part.1
Cours de Web Design part.1
 

Le responsive design avec les media queries | Alexis Macé

  • 1. MEDIA QUERIES LE RESPONSIVE DESIGN AVEC LES 1MACÉ ALEXIS - LES MEDIA QUERIES
  • 2. QU’EST-CE QU’UNE MEDIA QUERIES ? ▸ Spécification CSS3 pour attribuer une ou plusieurs propriétés CSS uniquement lorsque la condition spécifiée a lieu. ▸ Se créée avec @media suivie du type de l’écran et de conditions. ▸ S’intègre directement dans le fichier style.css du site. Il y a également la possibilité de créer une feuille de style spéciale de l’appeler depuis votre HTML : <link rel="stylesheet" media="screen and (max-width: votre_resolution_en_px) » href=« votre-fichier. css» /> 2MACÉ ALEXIS - LES MEDIA QUERIES
  • 3. LA CONSTRUCTION DES MÉDIAS QUERIES ▸ Les principaux critères disponibles : ▸ Width : largeur dans le navigateur; ▸ Height : hauteur dans le navigateur; ▸ Device-width : largeur de l’écran de l’appareil; ▸ Device-height : hauteur de l’écran de l’appareil; ▸ Orientation : orientation de l’appareil. ▸ Ces critères peuvent être associer avec « only », « and » et « not ». 3MACÉ ALEXIS - LES MEDIA QUERIES
  • 4. LA CONSTRUCTION DES MÉDIAS QUERIES ▸ Mise en pratique ▸ Si l’on ne veut pas afficher nos h2 lorsque l’écran passe en dessous des 480px. ▸ @media all and (min-width: 480px) { h2{ display:none; } } 4MACÉ ALEXIS - LES MEDIA QUERIES
  • 5. LA CONSTRUCTION DES MÉDIAS QUERIES ▸ Mise en pratique ▸ Si l’on ne veut pas afficher nos h2 lorsque les écrans sont orientés en mode portrait. ▸ @media all and (orientation:portrait) { h2{ display:none; } } 5MACÉ ALEXIS - LES MEDIA QUERIES