SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
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

Mais conteúdo relacionado

Destaque

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
DEEPAK 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 pictures
Susanna Martin
 
Big history
Big historyBig history
Big history
jrizo87
 
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
Gerd Groener
 
Aitiidiikiiwan priid.impress
Aitiidiikiiwan priid.impressAitiidiikiiwan priid.impress
Aitiidiikiiwan priid.impress
fred17
 
Aitiidiikiiwan priid.impress
Aitiidiikiiwan priid.impressAitiidiikiiwan priid.impress
Aitiidiikiiwan priid.impress
fred17
 
ฉันเหมือนใคร
ฉันเหมือนใครฉันเหมือนใคร
ฉันเหมือนใคร
phaiza
 
介绍Dbms registry plsql程序包1
介绍Dbms registry plsql程序包1介绍Dbms registry plsql程序包1
介绍Dbms registry plsql程序包1
maclean liu
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
maclean liu
 

Destaque (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
 

Semelhante a CSS3

OpenCode beta : Haml & Sass
OpenCode beta : Haml & SassOpenCode beta : Haml & Sass
OpenCode beta : Haml & Sass
Rémi Prévost
 
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
Horacio Gonzalez
 
CSS3 Intel Webinar
CSS3 Intel WebinarCSS3 Intel Webinar
CSS3 Intel Webinar
ViniSketch
 

Semelhante 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

Copie de Engineering Software Marketing Plan by Slidesgo.pptx.pptx
Copie de Engineering Software Marketing Plan by Slidesgo.pptx.pptxCopie de Engineering Software Marketing Plan by Slidesgo.pptx.pptx
Copie de Engineering Software Marketing Plan by Slidesgo.pptx.pptx
ikospam0
 
Cours Préparation à l’ISO 27001 version 2022.pdf
Cours Préparation à l’ISO 27001 version 2022.pdfCours Préparation à l’ISO 27001 version 2022.pdf
Cours Préparation à l’ISO 27001 version 2022.pdf
ssuserc72852
 
Bilan énergétique des chambres froides.pdf
Bilan énergétique des chambres froides.pdfBilan énergétique des chambres froides.pdf
Bilan énergétique des chambres froides.pdf
AmgdoulHatim
 

Último (20)

Copie de Engineering Software Marketing Plan by Slidesgo.pptx.pptx
Copie de Engineering Software Marketing Plan by Slidesgo.pptx.pptxCopie de Engineering Software Marketing Plan by Slidesgo.pptx.pptx
Copie de Engineering Software Marketing Plan by Slidesgo.pptx.pptx
 
La nouvelle femme . pptx Film français
La   nouvelle   femme  . pptx  Film françaisLa   nouvelle   femme  . pptx  Film français
La nouvelle femme . pptx Film français
 
Cours Préparation à l’ISO 27001 version 2022.pdf
Cours Préparation à l’ISO 27001 version 2022.pdfCours Préparation à l’ISO 27001 version 2022.pdf
Cours Préparation à l’ISO 27001 version 2022.pdf
 
La mondialisation avantages et inconvénients
La mondialisation avantages et inconvénientsLa mondialisation avantages et inconvénients
La mondialisation avantages et inconvénients
 
Cours ofppt du Trade-Marketing-Présentation.pdf
Cours ofppt du Trade-Marketing-Présentation.pdfCours ofppt du Trade-Marketing-Présentation.pdf
Cours ofppt du Trade-Marketing-Présentation.pdf
 
L application de la physique classique dans le golf.pptx
L application de la physique classique dans le golf.pptxL application de la physique classique dans le golf.pptx
L application de la physique classique dans le golf.pptx
 
Formation échiquéenne jwhyCHESS, parallèle avec la planification de projet
Formation échiquéenne jwhyCHESS, parallèle avec la planification de projetFormation échiquéenne jwhyCHESS, parallèle avec la planification de projet
Formation échiquéenne jwhyCHESS, parallèle avec la planification de projet
 
Computer Parts in French - Les parties de l'ordinateur.pptx
Computer Parts in French - Les parties de l'ordinateur.pptxComputer Parts in French - Les parties de l'ordinateur.pptx
Computer Parts in French - Les parties de l'ordinateur.pptx
 
Boléro. pptx Film français réalisé par une femme.
Boléro.  pptx   Film   français   réalisé  par une  femme.Boléro.  pptx   Film   français   réalisé  par une  femme.
Boléro. pptx Film français réalisé par une femme.
 
Bilan énergétique des chambres froides.pdf
Bilan énergétique des chambres froides.pdfBilan énergétique des chambres froides.pdf
Bilan énergétique des chambres froides.pdf
 
Chapitre 2 du cours de JavaScript. Bon Cours
Chapitre 2 du cours de JavaScript. Bon CoursChapitre 2 du cours de JavaScript. Bon Cours
Chapitre 2 du cours de JavaScript. Bon Cours
 
L'expression du but : fiche et exercices niveau C1 FLE
L'expression du but : fiche et exercices  niveau C1 FLEL'expression du but : fiche et exercices  niveau C1 FLE
L'expression du but : fiche et exercices niveau C1 FLE
 
Les roches magmatique géodynamique interne.pptx
Les roches magmatique géodynamique interne.pptxLes roches magmatique géodynamique interne.pptx
Les roches magmatique géodynamique interne.pptx
 
Intégration des TICE dans l'enseignement de la Physique-Chimie.pptx
Intégration des TICE dans l'enseignement de la Physique-Chimie.pptxIntégration des TICE dans l'enseignement de la Physique-Chimie.pptx
Intégration des TICE dans l'enseignement de la Physique-Chimie.pptx
 
CompLit - Journal of European Literature, Arts and Society - n. 7 - Table of ...
CompLit - Journal of European Literature, Arts and Society - n. 7 - Table of ...CompLit - Journal of European Literature, Arts and Society - n. 7 - Table of ...
CompLit - Journal of European Literature, Arts and Society - n. 7 - Table of ...
 
RAPPORT DE STAGE D'INTERIM DE ATTIJARIWAFA BANK
RAPPORT DE STAGE D'INTERIM DE ATTIJARIWAFA BANKRAPPORT DE STAGE D'INTERIM DE ATTIJARIWAFA BANK
RAPPORT DE STAGE D'INTERIM DE ATTIJARIWAFA BANK
 
Formation qhse - GIASE saqit_105135.pptx
Formation qhse - GIASE saqit_105135.pptxFormation qhse - GIASE saqit_105135.pptx
Formation qhse - GIASE saqit_105135.pptx
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...
 
Conférence Sommet de la formation 2024 : Développer des compétences pour la m...
Conférence Sommet de la formation 2024 : Développer des compétences pour la m...Conférence Sommet de la formation 2024 : Développer des compétences pour la m...
Conférence Sommet de la formation 2024 : Développer des compétences pour la m...
 
les_infections_a_streptocoques.pptkioljhk
les_infections_a_streptocoques.pptkioljhkles_infections_a_streptocoques.pptkioljhk
les_infections_a_streptocoques.pptkioljhk
 

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