SlideShare a Scribd company logo
1 of 45
10                     Advanced CSS Techniques
                       you always wanted to know more about
                                                             #webqcss




Some rights reserved                       Webuquerque November 2, 2011
He llo!
             Jason Nakai                            Emily Lewis
             Designer Developer                     Web Designer Writer        Instructor
             nakaimedia.com                         emilylewisdesign.com

Software Engineer, Data Basis          Co-host, EE Podcast
data-basis.com                         ee-podcast.com

Co-founder & Co-manager, Webuquerque   Co-founder & Co-manager, Webuquerque
webuquerque.com                        webuquerque.com

Email:     info@nakaimedia.com         Author, Microformats Made Simple
Twitter:   @jasonnakai                 microformatsmadesimple.com

                                       Contributing author, HTML5 Cookbook
                                       oreilly.com/catalog/0636920016038

                                       Email:     emily@emilylewisdesign.com
                                       Blog:      ablognotlimited.com
                                       Twitter:   @emilylewis


                                                                                #webqcss
esome
10                a nd Aw
         Advanced^Techniques
1. Text shadows          6. Multiple background images

2. Box shadows           7. Transitions

3. Generated content     8. Transforms

4. Attribute selectors   9. Media queries

5. Gradients             10.Feature detection




                                                #webqcss
1Text Shadows
text-shadow casts shadow effects on text and text-
decoration.




                                                     #webqcss
1
Text Shadows tax
          Syn
    h3 {text-shadow: 1px 1px 2px #000;}

•   x (horizontal) offset casts shadow to the right of the
    text. Negative value casts to the left.

•   y (vertical) offset casts shadow below the text.
    Negative value casts above.

•   blur radius blurs the shadow, with higher values
    making the shadows wider and lighter.

•   color
                                                        #webqcss
1Text Shadows tax
           Syn
Multiple effects are comma-separated and are applied
front to back, with the first shadow on the top of the stack.

                 text-shadow:         #fff    -1px   -1px,
                                      #fff    -2px   -2px,
                                      #fff    -3px   -3px,
                                      #fff    -4px   -4px,
                                      #fff    -5px   -5px,
                                      #fff    -6px   -6px,
                                      #fff    -7px   -7px,
                                      #fff    -8px   -8px;
                                                         #webqcss
1
Text Shadows esou
•
       T ools &R  rces

    Typekit text shadow tutorial
    blog.typekit.com/2011/07/19/shading-with-css-text-shadows/


•   Dynamic text shadow generator
    mothereffingtextshadow.com


•   Dynamic text shadow generator
    westciv.com/tools/shadows/


•   IE Shadow filter
    msdn.microsoft.com/en-us/library/ms533086(v=VS.85).aspx


•   IE DropShadow filter
    msdn.microsoft.com/en-us/library/ms532985(v=VS.85).aspx
                                                                 #webqcss
2Box Shadows
box-shadow casts shadow effects on block-level
elements.




                                                 #webqcss
2  Box Shadowsntax
            Sy
div {box-shadow: inset 2px 2px 3px 1px #666;}

   •   inset moves shadow inside frame of element.

   •   x (horizontal) offset casts shadow to the right of the
       text. Negative value casts to the left.

   •   y (vertical) offset casts shadow below the text.
       Negative value casts above.



                                                           #webqcss
2  Box Shadowsntax
            Sy
div {box-shadow: inset 2px 2px 3px 1px #666;}

   •   blur radius blurs the shadow, with higher values
       making the shadows wider and lighter.

   •   spread radius conrtrols the expansion of the
       shadow, with higher values making it bigger.

   •   color



                                                          #webqcss
2 Box Shadowsntax
           Sy
Vendor prefixes are available for older versions, which
should be listed before the standard property.


 -moz-box-shadow:    2px 2px 3px #666;
 -webkit-box-shadow: 2px 2px 3px #666;
 box-shadow:         2px 2px 3px #666;

Automatic prefixing with JavaScript
leaverou.github.com/prefixfree/




                                                          #webqcss
2Box Shadowsntax
          Sy
Multiple effects are applied front to back, with the first
shadow on top of the stack.

              box-shadow:         1px   1px   #007d9a,
                                  2px   2px   #007d9a,
                                  3px   3px   #007d9a,
                                  4px   4px   #007d9a,
                                  5px   5px   #007d9a,
                                  6px   6px   #007d9a,
                                  7px   7px   #007d9a,
                                  8px   8px   #007d9a;
                                                             #webqcss
2
Box ShadowsResou
•
      To ols &
                 rces

    CSS Tricks box shadow tutorial
    css-tricks.com/snippets/css/css-box-shadow/


•   Drop shadows tutorial & example gallery
    nicolasgallagher.com/css-drop-shadows-without-images/


•   Dynamic box shadow generator
    westciv.com/tools/box-properties/index.html


•   CSS3 decorations for IE
    css3pie.com


•   IE DropShadow filter
    msdn.microsoft.com/en-us/library/ms532985(v=VS.85).aspx
                                                              #webqcss
3   Generated Content
Using the :before and :after pseudo elements, can
insert content before and after the specified element:

•   Strings of text

•   Images

•   Counters

•   Attribute values (i.e. title)



                                                         #webqcss
3 Generated Contenttax
                Syn
a:after {content:" 00a000bb";}

  •   content property contains the content to appear
      before or after the element.

  •   For text strings, contain the value in quotes.

  •   If you want to use a special character, make sure it is
      properly encoded (digitalmediaminute.com/
      reference/entity/).


                                                          #webqcss
3
Generated Contenttax
              Syn
                   li:hover:before {
                      content:url(arrow.png);
                      position:absolute;
                      top:-17px;
                      left:0;}

•   :before and :after can also be combined with
    pseudo-classes like :hover.

•   content property can only be used on :before
    and :after.
                                                   #webqcss
3
•
    Generated Contentsources
             To ols & Re
    Generated content tutorial & speech bubble gallery
    http://nicolasgallagher.com/pure-css-speech-bubbles/


•   Tooltips with generated content
    http://jsfiddle.net/chriscoyier/EMhRJ/92/


•   Automatic numbering & counters
    dev.opera.com/articles/view/automatic-numbering-with-css-counters/


•   Pure CSS3 boxes without images
    webdesignshock.com/css3-box-shadow/




                                                                         #webqcss
4Attribute Selectors
Attribute selectors allow you to target elements based
on their attributes.
• [attr]                   • [attr^=value]
• [attr=value]             • [attr$=value]
• [attr~=value]            • [attr*=value]
• [attr|=value]


                                                         #webqcss
4Attribute Selectorstax
                Syn
a[href$="zip"]{...;}
input[type="submit"][value="Search"]{...;}


 •   Attribute property and
     value are specified
     within brackets

 •   Can use multiple
     selectors for greater
     specificity
                                      #webqcss
4
•
    Attribute Selectors esources
                Tools &R
    Emily’s attribute selectors tutorial
    msdn.microsoft.com/en-us/scriptjunkie/gg619394


•   CSS3 selectors explained
    456bereastreet.com/archive/200601/css_3_selectors_explained/


•   CSS Tricks attribute selectors tutorial
    css-tricks.com/5591-attribute-selectors/


•   ARIA roles & attribute selectors
    germanforblack.com/articles/stepping-into-attribute-selectors


•   IE support for CSS3 selectors
    selectivizr.com
                                                                    #webqcss
5   Gradients
Gradients allow smooth transitions between two or
more colors. Can reduce need for background images.
•   Linear

•   Radial

•   Specified via background-image




                                                      #webqcss
5
Linear Gradientsntax
div {
              Sy
  background-image: linear-
gradient(-90deg, #fff 0%, #ccc 100%);
}

•   Angle determines the direction of the gradient.

•   Color stop defines the color and it’s position relative
    to the element. Can have multiple, comma-separated
    color stops.



                                                        #webqcss
5
Radial Gradientsntax
div {
             Sy
  background-image:radial-
gradient(center, ellipse cover, #ff0
0%, #0f0 100%);
}

•   Position indicates the origin (center) of the gradient.

•   Shape and size of the gradient

•   Color stops, comma-separated

                                                         #webqcss
5   Gradientsntax
           Sy
  Vendor prefixes are required.

-moz-linear-gradient              -moz-radial-gradient
-o-linear-gradient                -webkit-radial-gradient
-webkit-linear-gradient


  Dynamic cross-browser CSS3 generator (even includes
  older syntaxes and prefixes)
  css3please.com



                                                    #webqcss
5Gradientsntax
        Sy
Multiple gradients can be applied, creating complex
(and even repeating) patterns.




                                                      #webqcss
5
•
    Gradients Resou
        Too ls &
                    rces

    Incredible background patterns gallery
    leaverou.me/css3patterns/


•   Dynamic linear gradient generator
    display-inline.fr/projects/css-gradient/


•   Dynamic radial gradient generator
    westciv.com/tools/radialgradients/index.html


•   Dynamic gradient generator (Firefox)
    colorzilla.com/gradient-editor/


•   CSS decorations for IE
    css3pie.com
                                                   #webqcss
6Multiple Background Images
CSS3 allows you to specify more than one background
image for an element.




                                                      #webqcss
6Multiple Background Imagesx
article {
  background:
                       S ynta

    url(curtainTop.png) 0 0 no-repeat,
    url(curtainBottom.png) 0 100% no-repeat
    #000;
}
 •   Comma-separated list of shorthand values for URL, x-
     axis, y-axis and repeat. Can also use full declarations.

 •   Images are layered, with first declared image on top of
     the stack. If using a background color, declare with
     last image to be at bottom of stack.
                                                         #webqcss
6Multiple Background Imagesx
article {
  background:
                       S ynta

    url(curtainBottom.png) 0 100% no-repeat
    #000;
  background:
    url(curtainTop.png) 0 0 no-repeat,
    url(curtainBottom.png) 0 100% no-repeat
    #000;
}
 For IE and other browser that don’t support, declare
 background twice.
                                                        #webqcss
6
•
    Multiple Background Imagesces
                    To ols & Re sour
    Multiple backgrounds & gradients tutorial
    snook.ca/archives/html_and_css/multiple-bg-css-gradients


•   CSS3 demo site from SXSW panel
    sxswcss3.com


•   Background patterns gallery
    leaverou.me/css3patterns/


•   CSS decorations for IE
    css3pie.com




                                                               #webqcss
7Transitions
transition enables smooth animations of CSS
property changes over a specified timeframe.




                                               #webqcss
7
Transitions ntax
         Sy
    div {transition: all .5s linear .2s;}

•    Property name specifies the CSS property to be
     changed.

•    Duration specifies the number of (milli)seconds a
     transition animation should take to complete.

•    Timing function specifies the easing

•    Delay indicates the amount of time to wait to start
     the transition effect
                                                           #webqcss
7Transitions ntax
          Sy
Vendor prefixes are required. Should be specified
before standard property.


-moz-transition:            all   .5s   linear      .2s;
-o-transition:              all   .5s   linear      .2s;
-webkit-transition:         all   .5s   linear      .2s;
transition:                 all   .5s   linear      .2s;




                                                       #webqcss
7
•
    Transitions& Resou
           T ools
                       rces

    Think Vitamin transitions tutorial
    thinkvitamin.com/code/sexy-interactions-with-css-transitions/


•   cubic-bezier() easing with transitions
    cubic-bezier.com


•   CSS transitions gallery
    leaverou.github.com/animatable/


•   Dynamic transitions generator
    css3generator.com




                                                                    #webqcss
8   Transforms
transform enables modifications to coordinate-based
CSS properties:

•   Translate

•   Rotate

•   Skew

•   Scale



                                                      #webqcss
8
Transforms ntax
        Sy
h3 {transform: rotate(45deg);}
h3 {transform: translate(25px, 10px);}


•   Transform functions specify the modification action
    and corresponding values.




                                                     #webqcss
8Transforms ntax
         Sy
Vendor prefixes are required. Should be specified
before standard property.


-moz-transform:            rotate(45deg);
-o-transform:              rotate(45deg);
-webkit-transform:         rotate(45deg);
transform:                 rotate(45deg);




                                                    #webqcss
8
•
    Transforms Resou
          To ols &
                     rces

    Transforms tutorial
    css3files.com/transform/


•   Text rotation tutorial
    snook.ca/archives/html_and_css/css-text-rotation


•   Transforms for IE
    useragentman.com/IETransformsTranslator/


•   Dynamic transforms generator
    westciv.com/tools/transforms/


•   Dynamic transforms generator
    css3generator.com
                                                       #webqcss
9   Media Queries
Media queries deliver styles based on the user’s display:

•   Media type

•   Browser window

•   Device screen, orientation & resolution

•   Colors




                                                       #webqcss
9
Media Queriesntax
           Sy
@media screen and (max-width: 650px){

}
   body {background: #f90;}


•   Nest resolution-specific styles within the @media
    query

•   Media options include all, handheld, projection,
    screen, tv

•   Properties and values establish the conditions for
    rendering styles

                                                         #webqcss
9
•
    Media QueriesResou
           To ols &
                       rces

    A List Apart’s responsive web design
    alistapart.com/articles/responsive-web-design/


•   Emily’s media queries tutorial
    msdn.microsoft.com/en-us/scriptjunkie/gg619395


•   Comprehensive media queries
    zomigi.com/blog/essential-considerations-for-crafting-quality-media-queries/


•   Media queries polyfill
    github.com/scottjehl/Respond


•   Dynamic resolution testing
    quirktools.com/screenfly/
                                                                         #webqcss
10  Feature Detection
Feature detection tests for the existence of DOM
properties and methods in order to determine whether
a browser supports an operation.
•   Modernizr (best bet)
    modernizr.com


•   jQuery.support (if you really want to)
    api.jquery.com/jQuery.support/


•   Rolling your own (not suggested)
    sitepoint.com/detect-css3-property-browser-support/


•   Browser sniffing (outdated)
                                                          #webqcss
10
•
    Feature Detection esources
              T ools &R
    Do you even need a polyfill? A fallback?
    caniuse.com


•   Conditional polyfill loading
    yepnopejs.com


•   Practical feature detection
    css-tricks.com/13641-sideways-headers/




                                               #webqcss
Questions?
         ?
 @emilylewis   @jasonnakai




                             #webqcss
Thanks!
           !
What did you think? spkr8.com/t/8859




                                       #webqcss

More Related Content

What's hot

Curso HTML 5 - Aula com Formulários, Imagens, Áudio e Vídeo
Curso HTML 5 - Aula com Formulários, Imagens, Áudio e VídeoCurso HTML 5 - Aula com Formulários, Imagens, Áudio e Vídeo
Curso HTML 5 - Aula com Formulários, Imagens, Áudio e VídeoTiago Antônio da Silva
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)Jay Patel
 
Html character entities
Html character entitiesHtml character entities
Html character entitiesnobel mujuji
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.jsDinesh U
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPwahidullah mudaser
 
PHP Aula 06 - Include, Require e Querystring
PHP Aula 06 - Include, Require e QuerystringPHP Aula 06 - Include, Require e Querystring
PHP Aula 06 - Include, Require e QuerystringDaniel Brandão
 
Introdução ao OpenLayers
Introdução ao OpenLayersIntrodução ao OpenLayers
Introdução ao OpenLayersFernando Quadro
 
Generic programming and concepts that should be in C++
Generic programming and concepts that should be in C++Generic programming and concepts that should be in C++
Generic programming and concepts that should be in C++Anton Kolotaev
 
CURSO JAVA - AULA 1 - INTRODUÇÃO LÓGICA DE PROGRAMAÇÃO
CURSO JAVA - AULA 1 - INTRODUÇÃO LÓGICA DE PROGRAMAÇÃOCURSO JAVA - AULA 1 - INTRODUÇÃO LÓGICA DE PROGRAMAÇÃO
CURSO JAVA - AULA 1 - INTRODUÇÃO LÓGICA DE PROGRAMAÇÃOMicrosoft
 
C# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net FrameworkC# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net FrameworkDr.Neeraj Kumar Pandey
 

What's hot (20)

Html projects for beginners
Html projects for beginnersHtml projects for beginners
Html projects for beginners
 
Curso HTML 5 - Aula com Formulários, Imagens, Áudio e Vídeo
Curso HTML 5 - Aula com Formulários, Imagens, Áudio e VídeoCurso HTML 5 - Aula com Formulários, Imagens, Áudio e Vídeo
Curso HTML 5 - Aula com Formulários, Imagens, Áudio e Vídeo
 
CS3391 -OOP -UNIT – V NOTES FINAL.pdf
CS3391 -OOP -UNIT – V NOTES FINAL.pdfCS3391 -OOP -UNIT – V NOTES FINAL.pdf
CS3391 -OOP -UNIT – V NOTES FINAL.pdf
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)
 
POO - Aula 10 - Polimorfismo
POO - Aula 10 - PolimorfismoPOO - Aula 10 - Polimorfismo
POO - Aula 10 - Polimorfismo
 
Introdução ao React
Introdução ao ReactIntrodução ao React
Introdução ao React
 
TypeScript Presentation
TypeScript PresentationTypeScript Presentation
TypeScript Presentation
 
Modularização
ModularizaçãoModularização
Modularização
 
Html character entities
Html character entitiesHtml character entities
Html character entities
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
 
Modern JS with ES6
Modern JS with ES6Modern JS with ES6
Modern JS with ES6
 
PHP Aula 06 - Include, Require e Querystring
PHP Aula 06 - Include, Require e QuerystringPHP Aula 06 - Include, Require e Querystring
PHP Aula 06 - Include, Require e Querystring
 
Introdução ao OpenLayers
Introdução ao OpenLayersIntrodução ao OpenLayers
Introdução ao OpenLayers
 
HTML Basics by software development company india
HTML Basics by software development company indiaHTML Basics by software development company india
HTML Basics by software development company india
 
Generic programming and concepts that should be in C++
Generic programming and concepts that should be in C++Generic programming and concepts that should be in C++
Generic programming and concepts that should be in C++
 
CURSO JAVA - AULA 1 - INTRODUÇÃO LÓGICA DE PROGRAMAÇÃO
CURSO JAVA - AULA 1 - INTRODUÇÃO LÓGICA DE PROGRAMAÇÃOCURSO JAVA - AULA 1 - INTRODUÇÃO LÓGICA DE PROGRAMAÇÃO
CURSO JAVA - AULA 1 - INTRODUÇÃO LÓGICA DE PROGRAMAÇÃO
 
C# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net FrameworkC# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net Framework
 
TypeScript Overview
TypeScript OverviewTypeScript Overview
TypeScript Overview
 
NodeJS
NodeJSNodeJS
NodeJS
 

Viewers also liked

Viewers also liked (6)

Create Your Own Starter Files
Create Your Own Starter FilesCreate Your Own Starter Files
Create Your Own Starter Files
 
ABORTO: EVOLUCIÓN O RETROCESO METODOS ABORTIVOS UNA FORMA DE ACABAR CON LA V...
ABORTO: EVOLUCIÓN O RETROCESO METODOS ABORTIVOS UNA FORMA DE ACABAR CON LA V...ABORTO: EVOLUCIÓN O RETROCESO METODOS ABORTIVOS UNA FORMA DE ACABAR CON LA V...
ABORTO: EVOLUCIÓN O RETROCESO METODOS ABORTIVOS UNA FORMA DE ACABAR CON LA V...
 
Pure CSS
Pure CSSPure CSS
Pure CSS
 
Pure CSS By Yahoo
Pure CSS By YahooPure CSS By Yahoo
Pure CSS By Yahoo
 
Css position
Css positionCss position
Css position
 
CSS Positioning
CSS PositioningCSS Positioning
CSS Positioning
 

Similar to 10 Advanced CSS Techniques (You Wish You Knew More About)

Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compassNick Cooley
 
[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)Christopher Schmitt
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondAndy Stratton
 
CSS3: Are you experienced?
CSS3: Are you experienced?CSS3: Are you experienced?
CSS3: Are you experienced?Denise Jacobs
 
[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 WorkshopChristopher Schmitt
 
Simply Responsive CSS3
Simply Responsive CSS3Simply Responsive CSS3
Simply Responsive CSS3Denise Jacobs
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondDenise Jacobs
 
Keep calm and let's play CSS3
Keep calm and let's play CSS3Keep calm and let's play CSS3
Keep calm and let's play CSS3A2 Comunicação
 
Rockstar Graphics with HTML5
Rockstar Graphics with HTML5Rockstar Graphics with HTML5
Rockstar Graphics with HTML5Dave Balmer
 
Next Steps in Responsive Design
Next Steps in Responsive DesignNext Steps in Responsive Design
Next Steps in Responsive DesignJustin Avery
 
CSS3: Ripe and Ready
CSS3: Ripe and ReadyCSS3: Ripe and Ready
CSS3: Ripe and ReadyDenise Jacobs
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSNaga Harish M
 
Advanced CSS Techniques
Advanced CSS TechniquesAdvanced CSS Techniques
Advanced CSS TechniquesKopepasah
 

Similar to 10 Advanced CSS Techniques (You Wish You Knew More About) (20)

Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and Beyond
 
CSS3: Are you experienced?
CSS3: Are you experienced?CSS3: Are you experienced?
CSS3: Are you experienced?
 
CSS3 3D Workshop
CSS3 3D WorkshopCSS3 3D Workshop
CSS3 3D Workshop
 
CSS and CSS3
CSS and CSS3CSS and CSS3
CSS and CSS3
 
[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop
 
Simply Responsive CSS3
Simply Responsive CSS3Simply Responsive CSS3
Simply Responsive CSS3
 
Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
 
Keep calm and let's play CSS3
Keep calm and let's play CSS3Keep calm and let's play CSS3
Keep calm and let's play CSS3
 
Rockstar Graphics with HTML5
Rockstar Graphics with HTML5Rockstar Graphics with HTML5
Rockstar Graphics with HTML5
 
Next Steps in Responsive Design
Next Steps in Responsive DesignNext Steps in Responsive Design
Next Steps in Responsive Design
 
CSS3: Ripe and Ready
CSS3: Ripe and ReadyCSS3: Ripe and Ready
CSS3: Ripe and Ready
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
 
Css3
Css3Css3
Css3
 
Advanced CSS Techniques
Advanced CSS TechniquesAdvanced CSS Techniques
Advanced CSS Techniques
 
Css3
Css3Css3
Css3
 
slides-students-C04.pdf
slides-students-C04.pdfslides-students-C04.pdf
slides-students-C04.pdf
 
Future proof rwd
Future proof rwdFuture proof rwd
Future proof rwd
 

More from Emily Lewis

The Hiring Process
The Hiring ProcessThe Hiring Process
The Hiring ProcessEmily Lewis
 
Take Your Markup to Eleven
Take Your Markup to ElevenTake Your Markup to Eleven
Take Your Markup to ElevenEmily Lewis
 
Designer-Friendly EE
Designer-Friendly EEDesigner-Friendly EE
Designer-Friendly EEEmily Lewis
 
Building the Webuquerque Community
Building the Webuquerque CommunityBuilding the Webuquerque Community
Building the Webuquerque CommunityEmily Lewis
 
Multiple Site Management with ExpressionEngine
Multiple Site Management with ExpressionEngineMultiple Site Management with ExpressionEngine
Multiple Site Management with ExpressionEngineEmily Lewis
 
Take Your Markup to 11
Take Your Markup to 11Take Your Markup to 11
Take Your Markup to 11Emily Lewis
 
WordPress & Other Content Management Systems
WordPress & Other Content Management SystemsWordPress & Other Content Management Systems
WordPress & Other Content Management SystemsEmily Lewis
 
Microformats or: How I Learned to Write POSH and Love the Semantic Web
Microformats or: How I Learned to Write POSH and Love the Semantic WebMicroformats or: How I Learned to Write POSH and Love the Semantic Web
Microformats or: How I Learned to Write POSH and Love the Semantic WebEmily Lewis
 
jQuery, A Designer's Perspective
jQuery, A Designer's PerspectivejQuery, A Designer's Perspective
jQuery, A Designer's PerspectiveEmily Lewis
 
Practical Microformats - Voices That Matter
Practical Microformats - Voices That MatterPractical Microformats - Voices That Matter
Practical Microformats - Voices That MatterEmily Lewis
 
[Workshop Summits] Microformats Workshop
[Workshop Summits] Microformats Workshop[Workshop Summits] Microformats Workshop
[Workshop Summits] Microformats WorkshopEmily Lewis
 
Microformats: Web Semantics & More
Microformats: Web Semantics & MoreMicroformats: Web Semantics & More
Microformats: Web Semantics & MoreEmily Lewis
 
Podcasting & Vodcasting 101
Podcasting & Vodcasting 101Podcasting & Vodcasting 101
Podcasting & Vodcasting 101Emily Lewis
 
Webuquerque: Social Media Means Business
Webuquerque: Social Media Means BusinessWebuquerque: Social Media Means Business
Webuquerque: Social Media Means BusinessEmily Lewis
 

More from Emily Lewis (14)

The Hiring Process
The Hiring ProcessThe Hiring Process
The Hiring Process
 
Take Your Markup to Eleven
Take Your Markup to ElevenTake Your Markup to Eleven
Take Your Markup to Eleven
 
Designer-Friendly EE
Designer-Friendly EEDesigner-Friendly EE
Designer-Friendly EE
 
Building the Webuquerque Community
Building the Webuquerque CommunityBuilding the Webuquerque Community
Building the Webuquerque Community
 
Multiple Site Management with ExpressionEngine
Multiple Site Management with ExpressionEngineMultiple Site Management with ExpressionEngine
Multiple Site Management with ExpressionEngine
 
Take Your Markup to 11
Take Your Markup to 11Take Your Markup to 11
Take Your Markup to 11
 
WordPress & Other Content Management Systems
WordPress & Other Content Management SystemsWordPress & Other Content Management Systems
WordPress & Other Content Management Systems
 
Microformats or: How I Learned to Write POSH and Love the Semantic Web
Microformats or: How I Learned to Write POSH and Love the Semantic WebMicroformats or: How I Learned to Write POSH and Love the Semantic Web
Microformats or: How I Learned to Write POSH and Love the Semantic Web
 
jQuery, A Designer's Perspective
jQuery, A Designer's PerspectivejQuery, A Designer's Perspective
jQuery, A Designer's Perspective
 
Practical Microformats - Voices That Matter
Practical Microformats - Voices That MatterPractical Microformats - Voices That Matter
Practical Microformats - Voices That Matter
 
[Workshop Summits] Microformats Workshop
[Workshop Summits] Microformats Workshop[Workshop Summits] Microformats Workshop
[Workshop Summits] Microformats Workshop
 
Microformats: Web Semantics & More
Microformats: Web Semantics & MoreMicroformats: Web Semantics & More
Microformats: Web Semantics & More
 
Podcasting & Vodcasting 101
Podcasting & Vodcasting 101Podcasting & Vodcasting 101
Podcasting & Vodcasting 101
 
Webuquerque: Social Media Means Business
Webuquerque: Social Media Means BusinessWebuquerque: Social Media Means Business
Webuquerque: Social Media Means Business
 

Recently uploaded

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Recently uploaded (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

10 Advanced CSS Techniques (You Wish You Knew More About)

  • 1. 10 Advanced CSS Techniques you always wanted to know more about #webqcss Some rights reserved Webuquerque November 2, 2011
  • 2. He llo! Jason Nakai Emily Lewis Designer Developer Web Designer Writer Instructor nakaimedia.com emilylewisdesign.com Software Engineer, Data Basis Co-host, EE Podcast data-basis.com ee-podcast.com Co-founder & Co-manager, Webuquerque Co-founder & Co-manager, Webuquerque webuquerque.com webuquerque.com Email: info@nakaimedia.com Author, Microformats Made Simple Twitter: @jasonnakai microformatsmadesimple.com Contributing author, HTML5 Cookbook oreilly.com/catalog/0636920016038 Email: emily@emilylewisdesign.com Blog: ablognotlimited.com Twitter: @emilylewis #webqcss
  • 3. esome 10 a nd Aw Advanced^Techniques 1. Text shadows 6. Multiple background images 2. Box shadows 7. Transitions 3. Generated content 8. Transforms 4. Attribute selectors 9. Media queries 5. Gradients 10.Feature detection #webqcss
  • 4. 1Text Shadows text-shadow casts shadow effects on text and text- decoration. #webqcss
  • 5. 1 Text Shadows tax Syn h3 {text-shadow: 1px 1px 2px #000;} • x (horizontal) offset casts shadow to the right of the text. Negative value casts to the left. • y (vertical) offset casts shadow below the text. Negative value casts above. • blur radius blurs the shadow, with higher values making the shadows wider and lighter. • color #webqcss
  • 6. 1Text Shadows tax Syn Multiple effects are comma-separated and are applied front to back, with the first shadow on the top of the stack. text-shadow: #fff -1px -1px, #fff -2px -2px, #fff -3px -3px, #fff -4px -4px, #fff -5px -5px, #fff -6px -6px, #fff -7px -7px, #fff -8px -8px; #webqcss
  • 7. 1 Text Shadows esou • T ools &R rces Typekit text shadow tutorial blog.typekit.com/2011/07/19/shading-with-css-text-shadows/ • Dynamic text shadow generator mothereffingtextshadow.com • Dynamic text shadow generator westciv.com/tools/shadows/ • IE Shadow filter msdn.microsoft.com/en-us/library/ms533086(v=VS.85).aspx • IE DropShadow filter msdn.microsoft.com/en-us/library/ms532985(v=VS.85).aspx #webqcss
  • 8. 2Box Shadows box-shadow casts shadow effects on block-level elements. #webqcss
  • 9. 2 Box Shadowsntax Sy div {box-shadow: inset 2px 2px 3px 1px #666;} • inset moves shadow inside frame of element. • x (horizontal) offset casts shadow to the right of the text. Negative value casts to the left. • y (vertical) offset casts shadow below the text. Negative value casts above. #webqcss
  • 10. 2 Box Shadowsntax Sy div {box-shadow: inset 2px 2px 3px 1px #666;} • blur radius blurs the shadow, with higher values making the shadows wider and lighter. • spread radius conrtrols the expansion of the shadow, with higher values making it bigger. • color #webqcss
  • 11. 2 Box Shadowsntax Sy Vendor prefixes are available for older versions, which should be listed before the standard property. -moz-box-shadow: 2px 2px 3px #666; -webkit-box-shadow: 2px 2px 3px #666; box-shadow: 2px 2px 3px #666; Automatic prefixing with JavaScript leaverou.github.com/prefixfree/ #webqcss
  • 12. 2Box Shadowsntax Sy Multiple effects are applied front to back, with the first shadow on top of the stack. box-shadow: 1px 1px #007d9a, 2px 2px #007d9a, 3px 3px #007d9a, 4px 4px #007d9a, 5px 5px #007d9a, 6px 6px #007d9a, 7px 7px #007d9a, 8px 8px #007d9a; #webqcss
  • 13. 2 Box ShadowsResou • To ols & rces CSS Tricks box shadow tutorial css-tricks.com/snippets/css/css-box-shadow/ • Drop shadows tutorial & example gallery nicolasgallagher.com/css-drop-shadows-without-images/ • Dynamic box shadow generator westciv.com/tools/box-properties/index.html • CSS3 decorations for IE css3pie.com • IE DropShadow filter msdn.microsoft.com/en-us/library/ms532985(v=VS.85).aspx #webqcss
  • 14. 3 Generated Content Using the :before and :after pseudo elements, can insert content before and after the specified element: • Strings of text • Images • Counters • Attribute values (i.e. title) #webqcss
  • 15. 3 Generated Contenttax Syn a:after {content:" 00a000bb";} • content property contains the content to appear before or after the element. • For text strings, contain the value in quotes. • If you want to use a special character, make sure it is properly encoded (digitalmediaminute.com/ reference/entity/). #webqcss
  • 16. 3 Generated Contenttax Syn li:hover:before { content:url(arrow.png); position:absolute; top:-17px; left:0;} • :before and :after can also be combined with pseudo-classes like :hover. • content property can only be used on :before and :after. #webqcss
  • 17. 3 • Generated Contentsources To ols & Re Generated content tutorial & speech bubble gallery http://nicolasgallagher.com/pure-css-speech-bubbles/ • Tooltips with generated content http://jsfiddle.net/chriscoyier/EMhRJ/92/ • Automatic numbering & counters dev.opera.com/articles/view/automatic-numbering-with-css-counters/ • Pure CSS3 boxes without images webdesignshock.com/css3-box-shadow/ #webqcss
  • 18. 4Attribute Selectors Attribute selectors allow you to target elements based on their attributes. • [attr] • [attr^=value] • [attr=value] • [attr$=value] • [attr~=value] • [attr*=value] • [attr|=value] #webqcss
  • 19. 4Attribute Selectorstax Syn a[href$="zip"]{...;} input[type="submit"][value="Search"]{...;} • Attribute property and value are specified within brackets • Can use multiple selectors for greater specificity #webqcss
  • 20. 4 • Attribute Selectors esources Tools &R Emily’s attribute selectors tutorial msdn.microsoft.com/en-us/scriptjunkie/gg619394 • CSS3 selectors explained 456bereastreet.com/archive/200601/css_3_selectors_explained/ • CSS Tricks attribute selectors tutorial css-tricks.com/5591-attribute-selectors/ • ARIA roles & attribute selectors germanforblack.com/articles/stepping-into-attribute-selectors • IE support for CSS3 selectors selectivizr.com #webqcss
  • 21. 5 Gradients Gradients allow smooth transitions between two or more colors. Can reduce need for background images. • Linear • Radial • Specified via background-image #webqcss
  • 22. 5 Linear Gradientsntax div { Sy background-image: linear- gradient(-90deg, #fff 0%, #ccc 100%); } • Angle determines the direction of the gradient. • Color stop defines the color and it’s position relative to the element. Can have multiple, comma-separated color stops. #webqcss
  • 23. 5 Radial Gradientsntax div { Sy background-image:radial- gradient(center, ellipse cover, #ff0 0%, #0f0 100%); } • Position indicates the origin (center) of the gradient. • Shape and size of the gradient • Color stops, comma-separated #webqcss
  • 24. 5 Gradientsntax Sy Vendor prefixes are required. -moz-linear-gradient -moz-radial-gradient -o-linear-gradient -webkit-radial-gradient -webkit-linear-gradient Dynamic cross-browser CSS3 generator (even includes older syntaxes and prefixes) css3please.com #webqcss
  • 25. 5Gradientsntax Sy Multiple gradients can be applied, creating complex (and even repeating) patterns. #webqcss
  • 26. 5 • Gradients Resou Too ls & rces Incredible background patterns gallery leaverou.me/css3patterns/ • Dynamic linear gradient generator display-inline.fr/projects/css-gradient/ • Dynamic radial gradient generator westciv.com/tools/radialgradients/index.html • Dynamic gradient generator (Firefox) colorzilla.com/gradient-editor/ • CSS decorations for IE css3pie.com #webqcss
  • 27. 6Multiple Background Images CSS3 allows you to specify more than one background image for an element. #webqcss
  • 28. 6Multiple Background Imagesx article { background: S ynta url(curtainTop.png) 0 0 no-repeat, url(curtainBottom.png) 0 100% no-repeat #000; } • Comma-separated list of shorthand values for URL, x- axis, y-axis and repeat. Can also use full declarations. • Images are layered, with first declared image on top of the stack. If using a background color, declare with last image to be at bottom of stack. #webqcss
  • 29. 6Multiple Background Imagesx article { background: S ynta url(curtainBottom.png) 0 100% no-repeat #000; background: url(curtainTop.png) 0 0 no-repeat, url(curtainBottom.png) 0 100% no-repeat #000; } For IE and other browser that don’t support, declare background twice. #webqcss
  • 30. 6 • Multiple Background Imagesces To ols & Re sour Multiple backgrounds & gradients tutorial snook.ca/archives/html_and_css/multiple-bg-css-gradients • CSS3 demo site from SXSW panel sxswcss3.com • Background patterns gallery leaverou.me/css3patterns/ • CSS decorations for IE css3pie.com #webqcss
  • 31. 7Transitions transition enables smooth animations of CSS property changes over a specified timeframe. #webqcss
  • 32. 7 Transitions ntax Sy div {transition: all .5s linear .2s;} • Property name specifies the CSS property to be changed. • Duration specifies the number of (milli)seconds a transition animation should take to complete. • Timing function specifies the easing • Delay indicates the amount of time to wait to start the transition effect #webqcss
  • 33. 7Transitions ntax Sy Vendor prefixes are required. Should be specified before standard property. -moz-transition: all .5s linear .2s; -o-transition: all .5s linear .2s; -webkit-transition: all .5s linear .2s; transition: all .5s linear .2s; #webqcss
  • 34. 7 • Transitions& Resou T ools rces Think Vitamin transitions tutorial thinkvitamin.com/code/sexy-interactions-with-css-transitions/ • cubic-bezier() easing with transitions cubic-bezier.com • CSS transitions gallery leaverou.github.com/animatable/ • Dynamic transitions generator css3generator.com #webqcss
  • 35. 8 Transforms transform enables modifications to coordinate-based CSS properties: • Translate • Rotate • Skew • Scale #webqcss
  • 36. 8 Transforms ntax Sy h3 {transform: rotate(45deg);} h3 {transform: translate(25px, 10px);} • Transform functions specify the modification action and corresponding values. #webqcss
  • 37. 8Transforms ntax Sy Vendor prefixes are required. Should be specified before standard property. -moz-transform: rotate(45deg); -o-transform: rotate(45deg); -webkit-transform: rotate(45deg); transform: rotate(45deg); #webqcss
  • 38. 8 • Transforms Resou To ols & rces Transforms tutorial css3files.com/transform/ • Text rotation tutorial snook.ca/archives/html_and_css/css-text-rotation • Transforms for IE useragentman.com/IETransformsTranslator/ • Dynamic transforms generator westciv.com/tools/transforms/ • Dynamic transforms generator css3generator.com #webqcss
  • 39. 9 Media Queries Media queries deliver styles based on the user’s display: • Media type • Browser window • Device screen, orientation & resolution • Colors #webqcss
  • 40. 9 Media Queriesntax Sy @media screen and (max-width: 650px){ } body {background: #f90;} • Nest resolution-specific styles within the @media query • Media options include all, handheld, projection, screen, tv • Properties and values establish the conditions for rendering styles #webqcss
  • 41. 9 • Media QueriesResou To ols & rces A List Apart’s responsive web design alistapart.com/articles/responsive-web-design/ • Emily’s media queries tutorial msdn.microsoft.com/en-us/scriptjunkie/gg619395 • Comprehensive media queries zomigi.com/blog/essential-considerations-for-crafting-quality-media-queries/ • Media queries polyfill github.com/scottjehl/Respond • Dynamic resolution testing quirktools.com/screenfly/ #webqcss
  • 42. 10 Feature Detection Feature detection tests for the existence of DOM properties and methods in order to determine whether a browser supports an operation. • Modernizr (best bet) modernizr.com • jQuery.support (if you really want to) api.jquery.com/jQuery.support/ • Rolling your own (not suggested) sitepoint.com/detect-css3-property-browser-support/ • Browser sniffing (outdated) #webqcss
  • 43. 10 • Feature Detection esources T ools &R Do you even need a polyfill? A fallback? caniuse.com • Conditional polyfill loading yepnopejs.com • Practical feature detection css-tricks.com/13641-sideways-headers/ #webqcss
  • 44. Questions? ? @emilylewis @jasonnakai #webqcss
  • 45. Thanks! ! What did you think? spkr8.com/t/8859 #webqcss