SlideShare une entreprise Scribd logo
Responsive design
1. Responsive ?
Définition 
Le Responsive Web design est une approche de conception 
Web qui vise à l'élaboration de sites offrant une 
expérience de lecture et de navigation optimales pour 
l'utilisateur quelle que soit sa gamme d’appareil. 
http://www.alsacreations.com
Gamme d’appareil ? (1)
Gamme d’appareil ? (2)
Gamme d’appareil ? (3)
Un site pour chaque device ?
Responsive webdesign, here we are ! 
Source : http://mediaqueri.es
Quelles technologies ? 
Grilles fluides 
- 
Media queries 
- 
Images flexibles 
- 
Typographie responsive
2. Grilles fluides
Relative units 
VS 
Fixed units
Fixed units - exemple 
#wrapper 
#header 
#sidebar #content 
#wrapper{ 
width: 960px; 
} 
#header{ 
width: 960px; 
} 
#sidebar{ 
width: 300px; 
margin-right: 20px; 
} 
#content{ 
width: 640px; 
}
Relative or fixed ? 
Pixels 
Points 
Pourcentage 
Em
Relative units - exemple 
#wrapper 
#header 
#sidebar #content 
#wrapper{ 
width: 100%; 
} 
#header{ 
width: 100%; 
} 
#sidebar{ 
width: 31.25%; 
margin-right: 2.08334%; 
} 
#content{ 
width: 66.66667%; 
}
Grille fluide 
25% 25% 25% 25% 
33% 33% 33% 
50% 50% 
100%
4. Images flexibles
Défault 
Images are not 
naturally fluid.
Solution : relative units 
img{ 
max-width:100%; 
height:auto; 
} 
L’image s’affichera à sa taille normal sauf si 
elle est plus large que son parent. Dans ce 
cas elle prendra la largeur de son parent.
Et pour les background ? 
img{ 
background: url('test.jpg') no-repeat 50% 50%; 
-webkit-background-size: cover; /* Chrome & Safari */ 
-moz-background-size: cover; /* Firefox */ 
-o-background-size: cover; /* Opera */ 
background-size: cover; 
} 
La taille de l’image s’adapte au conteneur en 
centrant verticalement et horizontalement.
3. Media queries
Définition 
Une media query est une expression dont la valeur est 
toujours true ou false. Il suffit d'associer les différentes 
déclarations possibles avec un opérateur logique pour 
définir l'ensemble des conditions à réunir pour l'application 
des styles compris dans le bloc adjacent. 
http://www.alsacreations.com
Types de média (css2) 
screen - handheld - print - speech - 
braille - embossed - projection - tv
Propriétés du device (css3) 
color - color-index - device-aspect-ratio 
- aspect-ratio - device-height -device-width 
- grid - height - monochrome - 
orientation - resolution - scan - width
Propriétés du device (css3) 
color - color-index - device-aspect-ratio 
- aspect-ratio - device-height -device-width 
- grid - height - monochrome - 
orientation - resolution - scan - width
Opérateurs logiques (css3) 
and - only - not
Exemples 
screen and (max-width: 640px) 
- 
only print 
- 
screen and (orientation: landscape) 
- 
not screen and (max-device-width: 480px)
Media query dans le head 
<!DOCTYPE html> 
<html> 
<head> 
... 
<link rel="stylesheet" media="screen" href="screen_style.css" type="text/css" /> 
<link rel="stylesheet" media="print" href="print_style.css" type="text/css" /> 
... 
</head> 
<body></body> 
</html>
Media query dans le css 
@media screen and (max-width: 640px) { 
h1{ 
color: red; 
} 
p{ 
color: blue; 
} 
} 
h1{ 
color: green; 
}
3. Typographie responsive
CSS Viewport Units 
The viewport-percentage lengths are relative to the size of 
the initial containing block. When the height or width of the 
initial containing block is changed, they are scaled accordingly. 
1vw = Equal to 1% of the width of the initial containing block. 
1vh = Equal to 1% of the height of the initial containing block. 
1vmin = Equal to the smaller of ‘vw’ or ‘vh’ 
1vmax = Equal to the larger of ‘vw’ or ‘vh’. 
http://www.w3.org/TR/css3-values/
Media Queries & em 
body { 
font-size: 100%; 
} 
h1 { 
font-size: 2.5em; 
} 
@media screen and (max-width: 50em) { 
h1 { 
font-size:2em; 
} 
} 
@media screen and (max-width: 40em) { 
h1 { 
font-size:1.5em; 
} 
}
Merci pour votre attention.
Bibliographie 
The 2014 Guide to Responsive Web Design - Nick Pettit 
http://blog.teamtreehouse.com/modern-field-guide-responsive-web-design 
Using CSS Background-size Responsively - Kean Richmond 
http://www.onextrapixel.com/2012/03/02/using-css-background-size-responsively/ 
Les Media Queries CSS3 - dew (Alsacréations) 
http://www.alsacreations.com/article/lire/930-css3-media-queries.html 
Techniques for Responsive Typography - Sara Soueidan 
http://tympanus.net/codrops/2013/11/19/techniques-for-responsive-typography/ 
Pragmatic responsive design - yiibu 
http://fr.slideshare.net/yiibu/pragmatic-responsive-design 
Responsive Webdesign – présent et futur de l’adaptation mobile - Stéphanie Walter 
http://www.alsacreations.com/article/lire/1559-responsive-web-design-present-futur-adaptation-mobile.html
Crédits 
Loïc Le Meur on Google Glass - Loïc Le Meur 
http://commons.wikimedia.org/wiki/File:A_Google_Glass_wearer.jpg

Contenu connexe

PDF
Architecture logicielle #5 : hipsto framework
Jean Michel
 
PDF
Javascript #4.2 : fonctions for pgm
Jean Michel
 
PDF
Javascript #10 : canvas
Jean Michel
 
PDF
PHP #6 : mysql
Jean Michel
 
PDF
Dev Web 101 #2 : development for dummies
Jean Michel
 
PDF
#1 entreprendre au xxiè siècle
Jean Michel
 
PDF
Javascript #2.2 : jQuery
Jean Michel
 
PDF
Gestion de projet #4 : spécification
Jean Michel
 
Architecture logicielle #5 : hipsto framework
Jean Michel
 
Javascript #4.2 : fonctions for pgm
Jean Michel
 
Javascript #10 : canvas
Jean Michel
 
PHP #6 : mysql
Jean Michel
 
Dev Web 101 #2 : development for dummies
Jean Michel
 
#1 entreprendre au xxiè siècle
Jean Michel
 
Javascript #2.2 : jQuery
Jean Michel
 
Gestion de projet #4 : spécification
Jean Michel
 

En vedette (20)

PDF
#4 css 101
Jean Michel
 
PDF
Javascript #4.1 : fonctions for noobs
Jean Michel
 
PDF
Gestion de projet #3 : besoin client
Jean Michel
 
PDF
Une introduction à Javascript
Jean Michel
 
PDF
Html & Css #6 : formulaires
Jean Michel
 
PDF
Projet timezone
Jean Michel
 
PDF
Javascript #5.1 : tp1 zombies!
Jean Michel
 
PDF
PHP & MYSQL #5 : fonctions
Jean Michel
 
PDF
Html & Css #5 : positionement
Jean Michel
 
PDF
Javascript #11: Space invader
Jean Michel
 
PDF
Wordpress #1 : introduction
Jean Michel
 
PDF
Architecture logicielle #2 : TP timezone
Jean Michel
 
PDF
#3 html in the real world
Jean Michel
 
PDF
Javascript #2 : valeurs, types & opérateurs
Jean Michel
 
PDF
Javascript #8 : événements
Jean Michel
 
PDF
Javascript #9 : barbarian quest
Jean Michel
 
PDF
Wordpress #2 : customisation
Jean Michel
 
PDF
PHP #3 : tableaux & formulaires
Jean Michel
 
PDF
Startup & entrepreneuriat #2.1: disrupt me
Jean Michel
 
PDF
Wordpress #3 : content strategie
Jean Michel
 
#4 css 101
Jean Michel
 
Javascript #4.1 : fonctions for noobs
Jean Michel
 
Gestion de projet #3 : besoin client
Jean Michel
 
Une introduction à Javascript
Jean Michel
 
Html & Css #6 : formulaires
Jean Michel
 
Projet timezone
Jean Michel
 
Javascript #5.1 : tp1 zombies!
Jean Michel
 
PHP & MYSQL #5 : fonctions
Jean Michel
 
Html & Css #5 : positionement
Jean Michel
 
Javascript #11: Space invader
Jean Michel
 
Wordpress #1 : introduction
Jean Michel
 
Architecture logicielle #2 : TP timezone
Jean Michel
 
#3 html in the real world
Jean Michel
 
Javascript #2 : valeurs, types & opérateurs
Jean Michel
 
Javascript #8 : événements
Jean Michel
 
Javascript #9 : barbarian quest
Jean Michel
 
Wordpress #2 : customisation
Jean Michel
 
PHP #3 : tableaux & formulaires
Jean Michel
 
Startup & entrepreneuriat #2.1: disrupt me
Jean Michel
 
Wordpress #3 : content strategie
Jean Michel
 
Publicité

Similaire à WebApp #2 : responsive design (20)

PPSX
Plasticité2015 technovf
Atelier IHM Polytech Nice Sophia
 
PDF
Les bases du responsive design
Voyelle Voyelle
 
PDF
Cours de Web Design part.1
MC Casal
 
PDF
Webdesign, UX et UCD #1
Relax In The Air
 
PPT
Intervention de Laurent Pierre Gilliard d'Aquitaine Europe Communication
MONA
 
PPT
Ergonomie des sites internet touristique
UNITEC
 
ODP
Trois avancées majeures en CSS3 : Media Queries, Grid Layout et Animations
Microsoft
 
PDF
Trois avancées majeures en CSS3 : Mediaqueries, Grid Layout et Animations (MS...
Raphaël Goetter
 
PDF
Un site mobile en une heure ? Top chrono ! (Barcamp-Bordeaux 2011)
Raphaël Goetter
 
PDF
Glossaire web pour les profanes - Webdesign
Relax In The Air
 
PDF
Responsive design, Canvas et SVG
Christian SUMBANG
 
ODP
Présentation de l'accessibilité numérique par Sébastien Huillet (Tribu And Co)
TribuAndCo
 
PDF
Css maintenable - Morgane Hervé
Web à Québec
 
PPTX
Du pixel au layout
Microsoft Technet France
 
KEY
2012 cyril-wolfangel-responsive design-typo3
Talan
 
DOCX
Ecole ESMA : Rapport de projet - Application de gestion d'une bibliotheque
Mehdi Hamime
 
PDF
HTML5, le nouveau buzzword
Frédéric Harper
 
PPTX
582 agr-li - interface mobile - classe 1
Alexandre Paradis
 
PDF
Applications web hautement évolutives sur Azure
Microsoft
 
PDF
Responsive Web Design : back to basics
Alinoa
 
Plasticité2015 technovf
Atelier IHM Polytech Nice Sophia
 
Les bases du responsive design
Voyelle Voyelle
 
Cours de Web Design part.1
MC Casal
 
Webdesign, UX et UCD #1
Relax In The Air
 
Intervention de Laurent Pierre Gilliard d'Aquitaine Europe Communication
MONA
 
Ergonomie des sites internet touristique
UNITEC
 
Trois avancées majeures en CSS3 : Media Queries, Grid Layout et Animations
Microsoft
 
Trois avancées majeures en CSS3 : Mediaqueries, Grid Layout et Animations (MS...
Raphaël Goetter
 
Un site mobile en une heure ? Top chrono ! (Barcamp-Bordeaux 2011)
Raphaël Goetter
 
Glossaire web pour les profanes - Webdesign
Relax In The Air
 
Responsive design, Canvas et SVG
Christian SUMBANG
 
Présentation de l'accessibilité numérique par Sébastien Huillet (Tribu And Co)
TribuAndCo
 
Css maintenable - Morgane Hervé
Web à Québec
 
Du pixel au layout
Microsoft Technet France
 
2012 cyril-wolfangel-responsive design-typo3
Talan
 
Ecole ESMA : Rapport de projet - Application de gestion d'une bibliotheque
Mehdi Hamime
 
HTML5, le nouveau buzzword
Frédéric Harper
 
582 agr-li - interface mobile - classe 1
Alexandre Paradis
 
Applications web hautement évolutives sur Azure
Microsoft
 
Responsive Web Design : back to basics
Alinoa
 
Publicité

Plus de Jean Michel (15)

PDF
Startup #7 : how to get customers
Jean Michel
 
PDF
HTML & CSS #10 : Bootstrap
Jean Michel
 
PDF
Architecture logicielle #4 : mvc
Jean Michel
 
PDF
Architecture logicielle #3 : object oriented design
Jean Michel
 
PDF
Architecture logicielle #1 : introduction
Jean Michel
 
PDF
PHP #7 : guess who?
Jean Michel
 
PDF
PHP #4 : sessions & cookies
Jean Michel
 
PDF
PHP #2 : variables, conditions & boucles
Jean Michel
 
PDF
PHP #1 : introduction
Jean Michel
 
PDF
Startup #5 : pitch
Jean Michel
 
PDF
WebApp #4 : Consuming REST APIs
Jean Michel
 
PDF
Projet timezone
Jean Michel
 
PDF
WebApp #3 : API
Jean Michel
 
PDF
WebApp #1 : introduction
Jean Michel
 
PDF
Javascript #7 : manipuler le dom
Jean Michel
 
Startup #7 : how to get customers
Jean Michel
 
HTML & CSS #10 : Bootstrap
Jean Michel
 
Architecture logicielle #4 : mvc
Jean Michel
 
Architecture logicielle #3 : object oriented design
Jean Michel
 
Architecture logicielle #1 : introduction
Jean Michel
 
PHP #7 : guess who?
Jean Michel
 
PHP #4 : sessions & cookies
Jean Michel
 
PHP #2 : variables, conditions & boucles
Jean Michel
 
PHP #1 : introduction
Jean Michel
 
Startup #5 : pitch
Jean Michel
 
WebApp #4 : Consuming REST APIs
Jean Michel
 
Projet timezone
Jean Michel
 
WebApp #3 : API
Jean Michel
 
WebApp #1 : introduction
Jean Michel
 
Javascript #7 : manipuler le dom
Jean Michel
 

WebApp #2 : responsive design

  • 3. Définition Le Responsive Web design est une approche de conception Web qui vise à l'élaboration de sites offrant une expérience de lecture et de navigation optimales pour l'utilisateur quelle que soit sa gamme d’appareil. http://www.alsacreations.com
  • 7. Un site pour chaque device ?
  • 8. Responsive webdesign, here we are ! Source : http://mediaqueri.es
  • 9. Quelles technologies ? Grilles fluides - Media queries - Images flexibles - Typographie responsive
  • 11. Relative units VS Fixed units
  • 12. Fixed units - exemple #wrapper #header #sidebar #content #wrapper{ width: 960px; } #header{ width: 960px; } #sidebar{ width: 300px; margin-right: 20px; } #content{ width: 640px; }
  • 13. Relative or fixed ? Pixels Points Pourcentage Em
  • 14. Relative units - exemple #wrapper #header #sidebar #content #wrapper{ width: 100%; } #header{ width: 100%; } #sidebar{ width: 31.25%; margin-right: 2.08334%; } #content{ width: 66.66667%; }
  • 15. Grille fluide 25% 25% 25% 25% 33% 33% 33% 50% 50% 100%
  • 17. Défault Images are not naturally fluid.
  • 18. Solution : relative units img{ max-width:100%; height:auto; } L’image s’affichera à sa taille normal sauf si elle est plus large que son parent. Dans ce cas elle prendra la largeur de son parent.
  • 19. Et pour les background ? img{ background: url('test.jpg') no-repeat 50% 50%; -webkit-background-size: cover; /* Chrome & Safari */ -moz-background-size: cover; /* Firefox */ -o-background-size: cover; /* Opera */ background-size: cover; } La taille de l’image s’adapte au conteneur en centrant verticalement et horizontalement.
  • 21. Définition Une media query est une expression dont la valeur est toujours true ou false. Il suffit d'associer les différentes déclarations possibles avec un opérateur logique pour définir l'ensemble des conditions à réunir pour l'application des styles compris dans le bloc adjacent. http://www.alsacreations.com
  • 22. Types de média (css2) screen - handheld - print - speech - braille - embossed - projection - tv
  • 23. Propriétés du device (css3) color - color-index - device-aspect-ratio - aspect-ratio - device-height -device-width - grid - height - monochrome - orientation - resolution - scan - width
  • 24. Propriétés du device (css3) color - color-index - device-aspect-ratio - aspect-ratio - device-height -device-width - grid - height - monochrome - orientation - resolution - scan - width
  • 25. Opérateurs logiques (css3) and - only - not
  • 26. Exemples screen and (max-width: 640px) - only print - screen and (orientation: landscape) - not screen and (max-device-width: 480px)
  • 27. Media query dans le head <!DOCTYPE html> <html> <head> ... <link rel="stylesheet" media="screen" href="screen_style.css" type="text/css" /> <link rel="stylesheet" media="print" href="print_style.css" type="text/css" /> ... </head> <body></body> </html>
  • 28. Media query dans le css @media screen and (max-width: 640px) { h1{ color: red; } p{ color: blue; } } h1{ color: green; }
  • 30. CSS Viewport Units The viewport-percentage lengths are relative to the size of the initial containing block. When the height or width of the initial containing block is changed, they are scaled accordingly. 1vw = Equal to 1% of the width of the initial containing block. 1vh = Equal to 1% of the height of the initial containing block. 1vmin = Equal to the smaller of ‘vw’ or ‘vh’ 1vmax = Equal to the larger of ‘vw’ or ‘vh’. http://www.w3.org/TR/css3-values/
  • 31. Media Queries & em body { font-size: 100%; } h1 { font-size: 2.5em; } @media screen and (max-width: 50em) { h1 { font-size:2em; } } @media screen and (max-width: 40em) { h1 { font-size:1.5em; } }
  • 32. Merci pour votre attention.
  • 33. Bibliographie The 2014 Guide to Responsive Web Design - Nick Pettit http://blog.teamtreehouse.com/modern-field-guide-responsive-web-design Using CSS Background-size Responsively - Kean Richmond http://www.onextrapixel.com/2012/03/02/using-css-background-size-responsively/ Les Media Queries CSS3 - dew (Alsacréations) http://www.alsacreations.com/article/lire/930-css3-media-queries.html Techniques for Responsive Typography - Sara Soueidan http://tympanus.net/codrops/2013/11/19/techniques-for-responsive-typography/ Pragmatic responsive design - yiibu http://fr.slideshare.net/yiibu/pragmatic-responsive-design Responsive Webdesign – présent et futur de l’adaptation mobile - Stéphanie Walter http://www.alsacreations.com/article/lire/1559-responsive-web-design-present-futur-adaptation-mobile.html
  • 34. Crédits Loïc Le Meur on Google Glass - Loïc Le Meur http://commons.wikimedia.org/wiki/File:A_Google_Glass_wearer.jpg