SlideShare una empresa de Scribd logo
1 de 34
Descargar para leer sin conexión
CSS3


http://tinyurl.com/wsf-css3
CSS3 ?
On attend depuis longtemps…


• Commencé en 1999
• Modulaire
• … CSS 2.1 n’est toujours pas terminé
Marre d’attendre ?
      Commençons !
•   Sélecteurs
•   Media Queries
•   Multi-column
•   Backgrounds
•   Borders
•   Box-shadow
•   Colors
•   Text
•   Transformations
•   Transformations + Transitions
•   Animations
Sélecteurs CSS 2.1
• * — Tous les éléments
  * { border: 0; }


• E — Éléments de type E
  p { line-height: 1.5; }


• E F — Éléments F descendants de E
  div a { text-decoration: underline; }


• E > F — Éléments F enfants de E
  div > ul { background: green; }
Sélecteurs CSS 2.1
• E + F — Éléments F directement précédé de E
  section h1 { margin: 1em; }


• E:lang(c) — Éléments E ayant la langue c
  span:lang(en) { font-style: italic; }


• E[foo] — Éléments E ayant l’attribut foo
  a[title] { border: 1px dotted #000; }
Sélecteurs CSS 2.1
• E :first-child — Premier élément de E
  div :first-child { margin: 0; }


• E:link, E:visited — Éléments E dont l’ancre
  n’a pas été visitée / a été visitée
  a:link    { color: blue; }
  a:visited { color: green; }


• E:active, E:hover, E:focus — Éléments E
  pendant des actions utilisateur
  a:active { background-color: yellow; }
Sélecteurs CSS 2.1
• E[foo="bar"] — Éléments E dont l’attribut foo
  vaut exactement bar
  a[href="#top"] { color: pink; }


• E[foo~="bar"] — Éléments E dont l’attribut foo
  contient bar
  div[class~="warning"] { background-color: yellow; }


• E[foo|="bar"] — Éléments E dont l’attribut foo
  commence par bar. Incluant le tiret.
  a[hreflang|="en"] { font-style: italic; }

  Fonctionne pour <a hreflang="en"> et <a hreflang="en-US">
Sélecteurs CSS 2.1

• .foo, E.foo — Éléments ou éléments E dont
  l’attribut class vaut foo
  .warning, div.warning { color: red; }


• #foo, E#foo — Éléments ou éléments E dont
  l’attribut id vaut foo
  #note, div#note { color: blue; }
Sélecteurs CSS3
• E ~ F — Éléments F précédé d’un élément E
  figure ~ figcaption { font-size: 80%; }


• E :not(s) — Éléments excluant le sélecteur s
  div *:not(p) { margin: 0; }


• E:root — Premier élément du document
  div:root { font-size: 100%; }
Sélecteurs CSS3
• E :last-child — Dernier enfant de E
  ul:last-child { margin-bottom: 1em; }


• E:empty — Éléments E vides
  div:empty { display: none; }


• E:target — Élément E cible de l’ancre en cours
  h1:target { text-decoration: underline; }
Sélecteurs CSS3
• E :nth-child(n) — Le      n ième   enfant de E
    div :nth-child(3) { background: red; }
    div :nth-child(3n+1) { background: red; }


• E :nth-last-child(n) — Idem, en comptant de la fin
    div :nth-last-child(3) { background: red; }


•   E:nth-of-type(n) — Le nième élément de type E
    div img:nth-of-type(3) { background: green; }


• E:nth-last-of-type(n) — Idem, en comptant de la fin
    div img:nth-last-of-type(3) { background: green; }
Sélecteurs CSS3
• E :only-child — Le seul enfant de E
  div :only-child { background: blue; }


• E:first-of-type — Le premier élément de type E
  div img:first-of-type { background: red; }


• E:last-of-type — Le dernier élément de type E
  div img:last-of-type { background: green; }


• E:only-of-type — Le seul élément de type E
  div p:only-of-type { background: yellow; }
Sélecteurs CSS3
• E[foo^="bar"] — Éléments E ayant l’attribut foo qui
  commence par bar
  a[class^="number-"] { padding: 0; }


• E[foo$="bar"] — Éléments E ayant l’attribut foo qui
  se termine par bar
  a[class$="ing"] { padding: 1em; }


• E[foo*="bar"] — Éléments E ayant l’attribut foo qui
  contient bar
  a[class*="ost"] { padding: .5em; }
Sélecteurs CSS3

• E:enabled, E:disabled — Éléments E activés /
  désactivés
  input:enabled   { background: #FFF; }
  input:disabled { background: grey; }


• E:checked — Éléments E cochés
  input[type="checkbox"]:checked { background: green; }
Media Queries
<link rel="stylesheet" type="text/css" media="screen" href="css/global.css">



                         •   all
                         •   braille, embossed
                         •   handheld
                         •   print
                         •   projection
                         •   screen
                         •   speech
                         •   tty
                         •   tv
Media Queries
+•   width, height, device-width, device-height
 • orientation
 • aspect-ratio, device-aspect-ratio
 • color, color-index, monochrome
 • resolution
 • (scan, grid)
Media Queries
+     only, not, and

               <link rel="stylesheet" type="text/css"
 media="screen and (min-width: 400px) and (max-width: 700px)"
                       href="css/global.css">




@media screen and (min-width: 400px) and (max-width: 700px) {
	 body {…}
}
Multi-column


p{
	

 column-width: 13em;
	

 column-gap: 1em;
}
Backgrounds
 background-origin




  background-size
Backgrounds
           multiple backgrounds




div {
	 background:
	 	 url(body-top.gif) top left no-repeat,
	 	 url(banner_fresco.jpg) 11px 11px no-repeat,
	 	 url(body-bottom.gif) bottom left no-repeat,
	 	 url(body-middle.gif) left repeat-y;
}
Backgrounds
                          Gradients



background: -moz-linear-gradient(left, #2E2E2E, #454545 10px);
background: -webkit-gradient(linear, 0 0, 10 0, from(#2E2E2E), to
(#454545));
background: linear-gradient(left, #2E2E2E, #454545 10px);
Backgrounds
                          Gradients




background: -moz-linear-gradient(left, #2E2E2E, #454545 10px);
background: -webkit-linear-gradient(left, #2E2E2E, #454545 10px);
background: linear-gradient(left, #2E2E2E, #454545 10px);
Backgrounds
                            Gradients



background:   url(fallback.png);
background:   -moz-linear-gradient(left, #2E2E2E, #454545 10px);
background:   -webkit-linear-gradient(left, #2E2E2E, #454545 10px);
background:   linear-gradient(left, #2E2E2E, #454545 10px);
Borders
border-image




border-radius
Box-shadow



div {
	 box-shadow: -10px -10px 0 0 #000;
}
Colors

• Opacity
• RGBA
• HSL, HSLA
Text
Web fonts (@font-face)




     text-shadow
Transformations

-moz-transform: rotate(-4deg);
-o-transform: rotate(-4deg);
-webkit-transform: rotate(-4deg);
transform: rotate(-4deg);
Transformations + Transitions
Animations
Et encore plein d’autres choses !
Ressources


•   CSS3 Previews http://www.css3.info/preview/

•   CSS3 Module Status http://www.css3.info/modules/

•   CSS3 Selectors Test http://tools.css3.info/selectors-test/
Ressources (démos)
•   Super awesome buttons with CSS3 http://www.zurb.com/
    blog_uploads/0000/0617/buttons-03.html

•   An image gallery showcase for CSS transitions http://
    devfiles.myopera.com/articles/1041/image-gallery.html

•   Pure CSS Coke Can http://www.romancortes.com/blog/pure-css-
    coke-can/

•   CSS 3D Meninas http://www.romancortes.com/blog/css-3d-meninas/

•   Sliding Vinyl with CSS3 http://www.zurb.com/playground/sliding-vinyl

•   47 amazing CSS3 animation demos http://
    www.webdesignerwall.com/trends/47-amazing-css3-animation-
    demos/
Contact


 Nicolas Le Gall
me@neovov.com

Más contenido relacionado

Destacado

Comparison table jan lokpal bill govt lokpal bill and ncpri drafts
Comparison table  jan lokpal bill govt lokpal bill and ncpri draftsComparison table  jan lokpal bill govt lokpal bill and ncpri drafts
Comparison table jan lokpal bill govt lokpal bill and ncpri draftsDEEPAK YADAV
 
The future of hands on learning technologies-no pictures
The future of hands on learning technologies-no picturesThe future of hands on learning technologies-no pictures
The future of hands on learning technologies-no picturesSusanna Martin
 
Opportunity Flipchart Screen Res
Opportunity Flipchart Screen ResOpportunity Flipchart Screen Res
Opportunity Flipchart Screen ResRalfWiebeck
 
Big history
Big historyBig history
Big historyjrizo87
 
Linked Data Techniques for MOF compliant Models
Linked Data Techniques for MOF compliant ModelsLinked Data Techniques for MOF compliant Models
Linked Data Techniques for MOF compliant ModelsGerd Groener
 
Aitiidiikiiwan priid.impress
Aitiidiikiiwan priid.impressAitiidiikiiwan priid.impress
Aitiidiikiiwan priid.impressfred17
 
Aitiidiikiiwan priid.impress
Aitiidiikiiwan priid.impressAitiidiikiiwan priid.impress
Aitiidiikiiwan priid.impressfred17
 
ฉันเหมือนใคร
ฉันเหมือนใครฉันเหมือนใคร
ฉันเหมือนใครphaiza
 
介绍Dbms registry plsql程序包1
介绍Dbms registry plsql程序包1介绍Dbms registry plsql程序包1
介绍Dbms registry plsql程序包1maclean liu
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_pptmaclean liu
 
Puntuaciones provisionales (miércoles 26 a las 16h)
Puntuaciones provisionales (miércoles 26 a las 16h)Puntuaciones provisionales (miércoles 26 a las 16h)
Puntuaciones provisionales (miércoles 26 a las 16h)Emi Voces
 

Destacado (17)

Comparison table jan lokpal bill govt lokpal bill and ncpri drafts
Comparison table  jan lokpal bill govt lokpal bill and ncpri draftsComparison table  jan lokpal bill govt lokpal bill and ncpri drafts
Comparison table jan lokpal bill govt lokpal bill and ncpri drafts
 
The future of hands on learning technologies-no pictures
The future of hands on learning technologies-no picturesThe future of hands on learning technologies-no pictures
The future of hands on learning technologies-no pictures
 
Autodigest feb march
Autodigest feb marchAutodigest feb march
Autodigest feb march
 
Ais life 2010-2
Ais life 2010-2Ais life 2010-2
Ais life 2010-2
 
Opportunity Flipchart Screen Res
Opportunity Flipchart Screen ResOpportunity Flipchart Screen Res
Opportunity Flipchart Screen Res
 
Big history
Big historyBig history
Big history
 
Linked Data Techniques for MOF compliant Models
Linked Data Techniques for MOF compliant ModelsLinked Data Techniques for MOF compliant Models
Linked Data Techniques for MOF compliant Models
 
Aitiidiikiiwan priid.impress
Aitiidiikiiwan priid.impressAitiidiikiiwan priid.impress
Aitiidiikiiwan priid.impress
 
123
123123
123
 
Solaria training dessent
Solaria training dessentSolaria training dessent
Solaria training dessent
 
Aitiidiikiiwan priid.impress
Aitiidiikiiwan priid.impressAitiidiikiiwan priid.impress
Aitiidiikiiwan priid.impress
 
ฉันเหมือนใคร
ฉันเหมือนใครฉันเหมือนใคร
ฉันเหมือนใคร
 
介绍Dbms registry plsql程序包1
介绍Dbms registry plsql程序包1介绍Dbms registry plsql程序包1
介绍Dbms registry plsql程序包1
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
 
Oporrak
OporrakOporrak
Oporrak
 
Puntuaciones provisionales (miércoles 26 a las 16h)
Puntuaciones provisionales (miércoles 26 a las 16h)Puntuaciones provisionales (miércoles 26 a las 16h)
Puntuaciones provisionales (miércoles 26 a las 16h)
 
Meditation
MeditationMeditation
Meditation
 

Similar a CSS3

Intégrateurs, bousculez vos habitudes
Intégrateurs, bousculez vos habitudesIntégrateurs, bousculez vos habitudes
Intégrateurs, bousculez vos habitudesRaphaël Goetter
 
CSS Facile : organiser ses feuilles de style
CSS Facile : organiser ses feuilles de styleCSS Facile : organiser ses feuilles de style
CSS Facile : organiser ses feuilles de styleKaelig Deloumeau-Prigent
 
Chapitre 2 - Programmation web - 3) Le CSS.pdf
Chapitre 2 - Programmation web - 3) Le CSS.pdfChapitre 2 - Programmation web - 3) Le CSS.pdf
Chapitre 2 - Programmation web - 3) Le CSS.pdfAnouAr42
 
technologie web - part2
technologie web - part2technologie web - part2
technologie web - part2Benoît Simard
 
Internationalisation du Front
Internationalisation du FrontInternationalisation du Front
Internationalisation du FrontYannick Croissant
 
Gagnez en productivité grâce aux préprocesseurs css
Gagnez en productivité grâce aux préprocesseurs cssGagnez en productivité grâce aux préprocesseurs css
Gagnez en productivité grâce aux préprocesseurs csspefringant
 
Cours css niveau debutant
Cours css niveau debutantCours css niveau debutant
Cours css niveau debutantTheBest Icanbe
 
LESS : moins de CSS, plus de fun ! (KiwiParty 2011)
LESS : moins de CSS, plus de fun ! (KiwiParty 2011)LESS : moins de CSS, plus de fun ! (KiwiParty 2011)
LESS : moins de CSS, plus de fun ! (KiwiParty 2011)Corinne Schillinger
 
OpenCode beta : Haml & Sass
OpenCode beta : Haml & SassOpenCode beta : Haml & Sass
OpenCode beta : Haml & SassRémi Prévost
 
Soyez revolutionnaire, utilisez CSS2 !
Soyez revolutionnaire, utilisez CSS2 !Soyez revolutionnaire, utilisez CSS2 !
Soyez revolutionnaire, utilisez CSS2 !Raphaël Goetter
 
Enib cours c.a.i. web - séance #1 - html5 css3-js - 2
Enib   cours c.a.i. web - séance #1 - html5 css3-js - 2Enib   cours c.a.i. web - séance #1 - html5 css3-js - 2
Enib cours c.a.i. web - séance #1 - html5 css3-js - 2Horacio Gonzalez
 
W3 cafe ie10etwindows8
W3 cafe ie10etwindows8W3 cafe ie10etwindows8
W3 cafe ie10etwindows8davrous
 
CSS3 Intel Webinar
CSS3 Intel WebinarCSS3 Intel Webinar
CSS3 Intel WebinarViniSketch
 
Trois avancées majeures en CSS3 : Mediaqueries, Grid Layout et Animations (MS...
Trois avancées majeures en CSS3 : Mediaqueries, Grid Layout et Animations (MS...Trois avancées majeures en CSS3 : Mediaqueries, Grid Layout et Animations (MS...
Trois avancées majeures en CSS3 : Mediaqueries, Grid Layout et Animations (MS...Raphaël Goetter
 
Trois avancées majeures en CSS3 : Media Queries, Grid Layout et Animations
Trois avancées majeures en CSS3 : Media Queries, Grid Layout et AnimationsTrois avancées majeures en CSS3 : Media Queries, Grid Layout et Animations
Trois avancées majeures en CSS3 : Media Queries, Grid Layout et AnimationsMicrosoft
 
Devoxx France 2013: CSS, more or Less - http://www.devoxx.com/display/FR13/CS...
Devoxx France 2013: CSS, more or Less - http://www.devoxx.com/display/FR13/CS...Devoxx France 2013: CSS, more or Less - http://www.devoxx.com/display/FR13/CS...
Devoxx France 2013: CSS, more or Less - http://www.devoxx.com/display/FR13/CS...VISEO
 
Intégration web MMI
Intégration web MMIIntégration web MMI
Intégration web MMIPierre VERT
 

Similar a CSS3 (20)

Intégrateurs, bousculez vos habitudes
Intégrateurs, bousculez vos habitudesIntégrateurs, bousculez vos habitudes
Intégrateurs, bousculez vos habitudes
 
CSS Facile : organiser ses feuilles de style
CSS Facile : organiser ses feuilles de styleCSS Facile : organiser ses feuilles de style
CSS Facile : organiser ses feuilles de style
 
Chapitre 2 - Programmation web - 3) Le CSS.pdf
Chapitre 2 - Programmation web - 3) Le CSS.pdfChapitre 2 - Programmation web - 3) Le CSS.pdf
Chapitre 2 - Programmation web - 3) Le CSS.pdf
 
technologie web - part2
technologie web - part2technologie web - part2
technologie web - part2
 
Internationalisation du Front
Internationalisation du FrontInternationalisation du Front
Internationalisation du Front
 
Gagnez en productivité grâce aux préprocesseurs css
Gagnez en productivité grâce aux préprocesseurs cssGagnez en productivité grâce aux préprocesseurs css
Gagnez en productivité grâce aux préprocesseurs css
 
HTML5
HTML5HTML5
HTML5
 
Cours css niveau debutant
Cours css niveau debutantCours css niveau debutant
Cours css niveau debutant
 
LESS : moins de CSS, plus de fun ! (KiwiParty 2011)
LESS : moins de CSS, plus de fun ! (KiwiParty 2011)LESS : moins de CSS, plus de fun ! (KiwiParty 2011)
LESS : moins de CSS, plus de fun ! (KiwiParty 2011)
 
OpenCode beta : Haml & Sass
OpenCode beta : Haml & SassOpenCode beta : Haml & Sass
OpenCode beta : Haml & Sass
 
Soyez revolutionnaire, utilisez CSS2 !
Soyez revolutionnaire, utilisez CSS2 !Soyez revolutionnaire, utilisez CSS2 !
Soyez revolutionnaire, utilisez CSS2 !
 
Enib cours c.a.i. web - séance #1 - html5 css3-js - 2
Enib   cours c.a.i. web - séance #1 - html5 css3-js - 2Enib   cours c.a.i. web - séance #1 - html5 css3-js - 2
Enib cours c.a.i. web - séance #1 - html5 css3-js - 2
 
Une Introduction à R
Une Introduction à RUne Introduction à R
Une Introduction à R
 
Html
HtmlHtml
Html
 
W3 cafe ie10etwindows8
W3 cafe ie10etwindows8W3 cafe ie10etwindows8
W3 cafe ie10etwindows8
 
CSS3 Intel Webinar
CSS3 Intel WebinarCSS3 Intel Webinar
CSS3 Intel Webinar
 
Trois avancées majeures en CSS3 : Mediaqueries, Grid Layout et Animations (MS...
Trois avancées majeures en CSS3 : Mediaqueries, Grid Layout et Animations (MS...Trois avancées majeures en CSS3 : Mediaqueries, Grid Layout et Animations (MS...
Trois avancées majeures en CSS3 : Mediaqueries, Grid Layout et Animations (MS...
 
Trois avancées majeures en CSS3 : Media Queries, Grid Layout et Animations
Trois avancées majeures en CSS3 : Media Queries, Grid Layout et AnimationsTrois avancées majeures en CSS3 : Media Queries, Grid Layout et Animations
Trois avancées majeures en CSS3 : Media Queries, Grid Layout et Animations
 
Devoxx France 2013: CSS, more or Less - http://www.devoxx.com/display/FR13/CS...
Devoxx France 2013: CSS, more or Less - http://www.devoxx.com/display/FR13/CS...Devoxx France 2013: CSS, more or Less - http://www.devoxx.com/display/FR13/CS...
Devoxx France 2013: CSS, more or Less - http://www.devoxx.com/display/FR13/CS...
 
Intégration web MMI
Intégration web MMIIntégration web MMI
Intégration web MMI
 

Último

Guide Final de rédaction de mémoire de fin d'étude
Guide Final de rédaction de mémoire de fin d'étudeGuide Final de rédaction de mémoire de fin d'étude
Guide Final de rédaction de mémoire de fin d'étudeBenamraneMarwa
 
A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.Franck Apolis
 
MaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.pptMaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.pptssusercbaa22
 
systeme expert_systeme expert_systeme expert
systeme expert_systeme expert_systeme expertsysteme expert_systeme expert_systeme expert
systeme expert_systeme expert_systeme expertChristianMbip
 
Fondation Louis Vuitton. pptx
Fondation      Louis      Vuitton.   pptxFondation      Louis      Vuitton.   pptx
Fondation Louis Vuitton. pptxTxaruka
 
Bolero. pptx . Film de A nnne Fontaine
Bolero. pptx . Film   de  A nnne FontaineBolero. pptx . Film   de  A nnne Fontaine
Bolero. pptx . Film de A nnne FontaineTxaruka
 
Approche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptxApproche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptxssusercbaa22
 
Cours-irrigation_et_drainage_cours1.pptx
Cours-irrigation_et_drainage_cours1.pptxCours-irrigation_et_drainage_cours1.pptx
Cours-irrigation_et_drainage_cours1.pptxlamourfrantz
 
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...Faga1939
 
Formation M2i - Comprendre les neurosciences pour développer son leadership
Formation M2i - Comprendre les neurosciences pour développer son leadershipFormation M2i - Comprendre les neurosciences pour développer son leadership
Formation M2i - Comprendre les neurosciences pour développer son leadershipM2i Formation
 
presentation l'interactionnisme symbolique finale.pptx
presentation l'interactionnisme symbolique  finale.pptxpresentation l'interactionnisme symbolique  finale.pptx
presentation l'interactionnisme symbolique finale.pptxMalikaIdseaid1
 
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptxSAID MASHATE
 
Présentation de cartes d'extension zhr..pptx
Présentation de cartes d'extension zhr..pptxPrésentation de cartes d'extension zhr..pptx
Présentation de cartes d'extension zhr..pptxpopzair
 

Último (15)

Pâques de Sainte Marie-Euphrasie Pelletier
Pâques de Sainte Marie-Euphrasie PelletierPâques de Sainte Marie-Euphrasie Pelletier
Pâques de Sainte Marie-Euphrasie Pelletier
 
Guide Final de rédaction de mémoire de fin d'étude
Guide Final de rédaction de mémoire de fin d'étudeGuide Final de rédaction de mémoire de fin d'étude
Guide Final de rédaction de mémoire de fin d'étude
 
A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.
 
MaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.pptMaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.ppt
 
systeme expert_systeme expert_systeme expert
systeme expert_systeme expert_systeme expertsysteme expert_systeme expert_systeme expert
systeme expert_systeme expert_systeme expert
 
Fondation Louis Vuitton. pptx
Fondation      Louis      Vuitton.   pptxFondation      Louis      Vuitton.   pptx
Fondation Louis Vuitton. pptx
 
Bolero. pptx . Film de A nnne Fontaine
Bolero. pptx . Film   de  A nnne FontaineBolero. pptx . Film   de  A nnne Fontaine
Bolero. pptx . Film de A nnne Fontaine
 
Approche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptxApproche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptx
 
Cours-irrigation_et_drainage_cours1.pptx
Cours-irrigation_et_drainage_cours1.pptxCours-irrigation_et_drainage_cours1.pptx
Cours-irrigation_et_drainage_cours1.pptx
 
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
 
Formation M2i - Comprendre les neurosciences pour développer son leadership
Formation M2i - Comprendre les neurosciences pour développer son leadershipFormation M2i - Comprendre les neurosciences pour développer son leadership
Formation M2i - Comprendre les neurosciences pour développer son leadership
 
Evaluación Alumnos de Ecole Victor Hugo
Evaluación Alumnos de Ecole  Victor HugoEvaluación Alumnos de Ecole  Victor Hugo
Evaluación Alumnos de Ecole Victor Hugo
 
presentation l'interactionnisme symbolique finale.pptx
presentation l'interactionnisme symbolique  finale.pptxpresentation l'interactionnisme symbolique  finale.pptx
presentation l'interactionnisme symbolique finale.pptx
 
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
 
Présentation de cartes d'extension zhr..pptx
Présentation de cartes d'extension zhr..pptxPrésentation de cartes d'extension zhr..pptx
Présentation de cartes d'extension zhr..pptx
 

CSS3

  • 2. CSS3 ? On attend depuis longtemps… • Commencé en 1999 • Modulaire • … CSS 2.1 n’est toujours pas terminé
  • 3. Marre d’attendre ? Commençons ! • Sélecteurs • Media Queries • Multi-column • Backgrounds • Borders • Box-shadow • Colors • Text • Transformations • Transformations + Transitions • Animations
  • 4. Sélecteurs CSS 2.1 • * — Tous les éléments * { border: 0; } • E — Éléments de type E p { line-height: 1.5; } • E F — Éléments F descendants de E div a { text-decoration: underline; } • E > F — Éléments F enfants de E div > ul { background: green; }
  • 5. Sélecteurs CSS 2.1 • E + F — Éléments F directement précédé de E section h1 { margin: 1em; } • E:lang(c) — Éléments E ayant la langue c span:lang(en) { font-style: italic; } • E[foo] — Éléments E ayant l’attribut foo a[title] { border: 1px dotted #000; }
  • 6. Sélecteurs CSS 2.1 • E :first-child — Premier élément de E div :first-child { margin: 0; } • E:link, E:visited — Éléments E dont l’ancre n’a pas été visitée / a été visitée a:link { color: blue; } a:visited { color: green; } • E:active, E:hover, E:focus — Éléments E pendant des actions utilisateur a:active { background-color: yellow; }
  • 7. Sélecteurs CSS 2.1 • E[foo="bar"] — Éléments E dont l’attribut foo vaut exactement bar a[href="#top"] { color: pink; } • E[foo~="bar"] — Éléments E dont l’attribut foo contient bar div[class~="warning"] { background-color: yellow; } • E[foo|="bar"] — Éléments E dont l’attribut foo commence par bar. Incluant le tiret. a[hreflang|="en"] { font-style: italic; } Fonctionne pour <a hreflang="en"> et <a hreflang="en-US">
  • 8. Sélecteurs CSS 2.1 • .foo, E.foo — Éléments ou éléments E dont l’attribut class vaut foo .warning, div.warning { color: red; } • #foo, E#foo — Éléments ou éléments E dont l’attribut id vaut foo #note, div#note { color: blue; }
  • 9. Sélecteurs CSS3 • E ~ F — Éléments F précédé d’un élément E figure ~ figcaption { font-size: 80%; } • E :not(s) — Éléments excluant le sélecteur s div *:not(p) { margin: 0; } • E:root — Premier élément du document div:root { font-size: 100%; }
  • 10. Sélecteurs CSS3 • E :last-child — Dernier enfant de E ul:last-child { margin-bottom: 1em; } • E:empty — Éléments E vides div:empty { display: none; } • E:target — Élément E cible de l’ancre en cours h1:target { text-decoration: underline; }
  • 11. Sélecteurs CSS3 • E :nth-child(n) — Le n ième enfant de E div :nth-child(3) { background: red; } div :nth-child(3n+1) { background: red; } • E :nth-last-child(n) — Idem, en comptant de la fin div :nth-last-child(3) { background: red; } • E:nth-of-type(n) — Le nième élément de type E div img:nth-of-type(3) { background: green; } • E:nth-last-of-type(n) — Idem, en comptant de la fin div img:nth-last-of-type(3) { background: green; }
  • 12. Sélecteurs CSS3 • E :only-child — Le seul enfant de E div :only-child { background: blue; } • E:first-of-type — Le premier élément de type E div img:first-of-type { background: red; } • E:last-of-type — Le dernier élément de type E div img:last-of-type { background: green; } • E:only-of-type — Le seul élément de type E div p:only-of-type { background: yellow; }
  • 13. Sélecteurs CSS3 • E[foo^="bar"] — Éléments E ayant l’attribut foo qui commence par bar a[class^="number-"] { padding: 0; } • E[foo$="bar"] — Éléments E ayant l’attribut foo qui se termine par bar a[class$="ing"] { padding: 1em; } • E[foo*="bar"] — Éléments E ayant l’attribut foo qui contient bar a[class*="ost"] { padding: .5em; }
  • 14. Sélecteurs CSS3 • E:enabled, E:disabled — Éléments E activés / désactivés input:enabled { background: #FFF; } input:disabled { background: grey; } • E:checked — Éléments E cochés input[type="checkbox"]:checked { background: green; }
  • 15. Media Queries <link rel="stylesheet" type="text/css" media="screen" href="css/global.css"> • all • braille, embossed • handheld • print • projection • screen • speech • tty • tv
  • 16. Media Queries +• width, height, device-width, device-height • orientation • aspect-ratio, device-aspect-ratio • color, color-index, monochrome • resolution • (scan, grid)
  • 17. Media Queries + only, not, and <link rel="stylesheet" type="text/css" media="screen and (min-width: 400px) and (max-width: 700px)" href="css/global.css"> @media screen and (min-width: 400px) and (max-width: 700px) { body {…} }
  • 19. Backgrounds background-origin background-size
  • 20. Backgrounds multiple backgrounds div { background: url(body-top.gif) top left no-repeat, url(banner_fresco.jpg) 11px 11px no-repeat, url(body-bottom.gif) bottom left no-repeat, url(body-middle.gif) left repeat-y; }
  • 21. Backgrounds Gradients background: -moz-linear-gradient(left, #2E2E2E, #454545 10px); background: -webkit-gradient(linear, 0 0, 10 0, from(#2E2E2E), to (#454545)); background: linear-gradient(left, #2E2E2E, #454545 10px);
  • 22. Backgrounds Gradients background: -moz-linear-gradient(left, #2E2E2E, #454545 10px); background: -webkit-linear-gradient(left, #2E2E2E, #454545 10px); background: linear-gradient(left, #2E2E2E, #454545 10px);
  • 23. Backgrounds Gradients background: url(fallback.png); background: -moz-linear-gradient(left, #2E2E2E, #454545 10px); background: -webkit-linear-gradient(left, #2E2E2E, #454545 10px); background: linear-gradient(left, #2E2E2E, #454545 10px);
  • 25. Box-shadow div { box-shadow: -10px -10px 0 0 #000; }
  • 31. Et encore plein d’autres choses !
  • 32. Ressources • CSS3 Previews http://www.css3.info/preview/ • CSS3 Module Status http://www.css3.info/modules/ • CSS3 Selectors Test http://tools.css3.info/selectors-test/
  • 33. Ressources (démos) • Super awesome buttons with CSS3 http://www.zurb.com/ blog_uploads/0000/0617/buttons-03.html • An image gallery showcase for CSS transitions http:// devfiles.myopera.com/articles/1041/image-gallery.html • Pure CSS Coke Can http://www.romancortes.com/blog/pure-css- coke-can/ • CSS 3D Meninas http://www.romancortes.com/blog/css-3d-meninas/ • Sliding Vinyl with CSS3 http://www.zurb.com/playground/sliding-vinyl • 47 amazing CSS3 animation demos http:// www.webdesignerwall.com/trends/47-amazing-css3-animation- demos/
  • 34. Contact Nicolas Le Gall me@neovov.com