SlideShare una empresa de Scribd logo
1 de 66
Descargar para leer sin conexión
CSS3
                   The	
  web’s	
  Swiss	
  Army	
  Knife	
  updated	
  and	
  improved




Thursday, October 27, 2011
Stephanie (Sullivan) Rewis
                        Front-­‐end	
  developer
                        Principal	
  w3conversions.com
                        Wrote	
  the	
  CSS	
  Layouts	
  in	
  Dreamweaver
                        WaSP	
  corporate	
  liaison	
  to	
  Adobe
                        Customized	
  corporate	
  training	
  &	
  mentoring
                        Author	
  &	
  Speaker
                        TwiFer	
  addict	
  (@stefsull)




Thursday, October 27, 2011
If	
  we	
  use	
  these	
  techniques	
  right	
  [HTML	
  and	
  CSS3],	
  
                     we	
  can	
  get	
  rid	
  of	
  half	
  of	
  the	
  images	
  on	
  the	
  web,	
  
                     because	
  they're	
  used	
  for	
  styling.
                                                                              —	
  Håkon	
  Wium	
  Lie




Thursday, October 27, 2011
Benefits of CSS3
                     Reduced	
  development	
  and	
  maintenance	
  0me	
  
                     Increased	
  usability	
  &	
  accessibility
                     Be8er	
  search	
  engine	
  placement	
  due	
  to	
  real	
  text	
  and	
  
                     faster	
  pages
                     Op0mized	
  styles	
  based	
  on	
  device	
  capabili0es
                     Increased	
  page	
  performance
                     Reducing	
  the	
  number	
  of	
  HTTP	
  requests...is	
  the	
  most	
  
                     important	
  guideline	
  for	
  improving	
  performance	
  for	
  first	
  
                     0me	
  visitors.
                     Yahoo!  Excep,onal  Performance  Team,	
  
                     h8p://developer.yahoo.com/performance/rules.html


Thursday, October 27, 2011
CSS is Modular
                        It	
  will	
  never	
  be	
  done

                        Modules	
  are	
  in	
  varied	
  
                        states	
  of	
  compleVon




Thursday, October 27, 2011
CSS3 Prefixes
            You	
  can	
  use	
  it	
  today—
            but	
  know	
  your	
  prefixes

                  -­‐moz-­‐	
  Mozilla	
  
                  (Gecko	
  browsers)
                  -­‐webkit-­‐	
  Safari	
  
                  (plus	
  WebKit	
  browsers)
                  -­‐o-­‐	
  Opera	
  Soware
                  -­‐ms-­‐	
  Microso
                  -­‐khtml-­‐	
  Konqueror	
  
                  browser	
  (plus	
  Safari	
  1)


Thursday, October 27, 2011
When Can I Use...
                        CompaVbility	
  tables	
  for	
  features	
  in	
  HTML5,	
  CSS3,	
  
                        SVG	
  and	
  other	
  upcoming	
  web	
  technologies




Thursday, October 27, 2011
Modernizr — My Hero!
                        hFp://www.modernizr.com
                        Feature-­‐detecVon	
  library	
  for	
  HTML5	
  and	
  CSS3
                        Modernizr	
  creates	
  the	
  HTML5	
  elements	
  in	
  the	
  DOM




Thursday, October 27, 2011
Modernizr - Feature Detection
                        Link	
  to	
  the	
  script	
  &	
  add	
  <html	
  class=”no-­‐js”>
                        Modernizr	
  changes	
  the	
  no-­‐js	
  class	
  to	
  a	
  long	
  string	
  
                        of	
  classes	
  that	
  you	
  can	
  use	
  to	
  serve	
  different	
  CSS	
  
                        or	
  JS	
  to	
  a	
  browser	
  depending	
  on	
  its	
  lack	
  of	
  
                        capabiliVes.	
  ie:
                        <html	
  class=”	
  js	
  canvas	
  canvastext	
  geolocaVon	
  
                        crosswindowmessaging	
  no-­‐websqldatabase  no-­‐indexeddb	
  
                        hashchange	
  no-­‐historymanagement	
  draganddrop	
  no-­‐websockets	
  
                        rgba	
  hsla	
  mulVplebgs	
  backgroundsize	
  borderimage	
  borderradius	
  
                        boxshadow	
  opacity	
  no-­‐cssanimaVons	
  csscolumns	
  cssgradients	
  no-­‐
                        cssreflec8ons	
  csstransforms	
  no-­‐csstransforms3d  no-­‐csstransi8ons	
  
                        video	
  audio	
  localstorage	
  sessionstorage	
  webworkers	
  
                        applicaVoncache	
  svg	
  no-­‐smilsvgclippaths	
  foniace”>



Thursday, October 27, 2011
CSS based on abilities
                        Write	
  CSS	
  for	
  browsers	
  missing	
  support:
                        .no-­‐cssgradients	
  .element	
  {
                        	
  	
  	
  	
  background-­‐color:	
  #value;	
  	
  	
  /*or*/
                        	
  	
  	
  	
  background-­‐image:	
  url(img/gradient.jpg);
                        }

                        Or	
  write	
  CSS	
  so	
  it’s	
  only	
  shown	
  to	
  capable	
  
                        browsers:
                        .	
  cssgradients	
  .element	
  {
                        	
  	
  	
  	
  	
  background-­‐image:	
  -­‐webkit,	
  -­‐moz,	
  -­‐ms,	
  -­‐o,	
  etc;
                        }

Thursday, October 27, 2011
Backgrounds




Thursday, October 27, 2011
Three Boxes (Box Model)

                             border




Thursday, October 27, 2011
background-position (CSS3)
                        Four	
  values	
  are	
  now	
  possible:
                          boFom	
  	
  10px	
  	
  le	
  	
  -­‐15px
                                     x-­‐axis             y-­‐axis




                             boFom	
  	
  10px	
  	
  le	
  	
  -­‐15px



Thursday, October 27, 2011
background-repeat (CSS3)
                         Double	
  values	
  can	
  now	
  be	
  used:
                                                        x-­‐axis        y-­‐axis
                     background-­‐repeat:	
  repeat	
  no-­‐repeat;
                      Using	
  a	
  single	
  “repeat”	
  assumes	
  a	
  repeat	
  in	
  both	
  
                      direcVons.
                      Two  new  values:
                     space	
  -­‐	
  repeat	
  as	
  many	
  Vmes	
  as	
  will	
  fit	
  with	
  equal	
  
                     spacing	
  between	
  images
                     round	
  -­‐	
  rescales	
  the	
  image	
  so	
  it	
  
                     fits	
  an	
  equal	
  number	
  of	
  Vmes


Thursday, October 27, 2011
Flexible Control
                     New	
  levels	
  of	
  control	
  with	
  new	
  combinaVons

                     background-­‐repeat:	
  no-­‐repeat	
  space;




                     background-­‐repeat:	
  space	
  round;




Thursday, October 27, 2011
background-origin
            Background-­‐origin	
  specifies	
  the	
  star-ng  point	
  for	
  the	
  background	
  
            image
                       border-­‐box	
  -­‐	
  posiVons	
  the	
  
                       background	
  image	
  relaVve	
  
                       to	
  the	
  outer	
  edge	
  of	
  the	
  border
                       padding-­‐box	
  (default)	
  -­‐	
  posiVons	
  
                       the	
  background	
  image	
  relaVve	
  
                       to	
  the	
  outer	
  edge	
  of	
  the	
  padding	
  
                       (inner	
  edge	
  of	
  the	
  border)
                       content-­‐box	
  -­‐	
  posiVons	
  the	
  
                       background	
  image	
  relaVve	
  to	
  
                       the	
  outer	
  edge	
  of	
  the	
  content	
  
                       (inner	
  edge	
  of	
  the	
  padding)



Thursday, October 27, 2011
background-clip
            Background-­‐clip	
  hides	
  a	
  porVon	
  of	
  your	
  background


                       border-­‐box	
  (default)	
  -­‐	
  clips	
  
                       backgrounds	
  relaVve	
  to	
  the	
  outer	
  
                       edge	
  of	
  the	
  border
                       padding-­‐box	
  -­‐	
  clips	
  backgrounds	
  
                       relaVve	
  to	
  the	
  outer	
  edge	
  of	
  the	
  
                       padding	
  (inner	
  edge	
  of	
  the	
  border)
                       content-­‐box	
  -­‐	
  clips	
  backgrounds	
  
                       relaVve	
  to	
  the	
  outer	
  edge	
  of	
  the	
  
                       content	
  (inner	
  edge	
  of	
  the	
  
                       padding)



Thursday, October 27, 2011
background-size
            Background-­‐size	
  lets	
  you	
  specify	
  the	
  size	
  of	
  a	
  background	
  image	
  —	
  
            either	
  as	
  a	
  fixed	
  value,	
  or	
  relaVve	
  to	
  the	
  background  posi0oning  
            area
                       pixels	
  -­‐	
  define	
  one	
  or	
  both	
  values
                       percents	
  -­‐	
  define	
  one	
  or	
  both	
  values
                       cover	
  -­‐	
  covers	
  the	
  enVre	
  space	
  using	
  the	
  lesser	
  width	
  or	
  height.	
  
                       Warning:	
  Clipping	
  may	
  occur.
                       contain	
  -­‐	
  shows	
  the	
  enVre	
  image	
  based	
  on	
  the	
  greater	
  height	
  
                       or	
  width	
  of	
  the	
  image.	
  This	
  means	
  the	
  image	
  may	
  not	
  
                       completely	
  fill	
  the	
  background	
  posiVoning	
  area.
                       When	
  using	
  cover/contain	
  on	
  the	
  body	
  element,	
  set	
  the	
  height	
  
                       of	
  the	
  html	
  element	
  to	
  100%

Thursday, October 27, 2011
Thursday, October 27, 2011
.freshest { /* contains awning background */
                             !   width: 33.375em;
                             !   background-size: 100% auto; /* this allows the background image to
                             scale on the x-axis WITH larger text sizes */
                             !   font-size: 1em;
                             }
                             .homeLogo { /* logo base of the vege stand */
                             !   width: 33.75em;   !
                             !   height: 18.75em;
                             !   font-size: 1em; /* this causes image in the page to scale up as well */
                             !   -ms-interpolation-mode: bicubic; /* this helps IE to play nice when
                             scaling */
                             }
                             .navMain li { /* vege baskets */
                             !   height: 11.25em;
                             !   background-size: 100% 100%; /* this allows navigation images to scale
                             both directions WITH larger text */
                             }


Thursday, October 27, 2011
More Images - More Better
                        Syntax	
  (comma	
  separated):
                        background-­‐image:	
  url(“image01.jpg”),	
  url(image02.jpg”);
                        Subsequent	
  background	
  properVes,	
  such	
  as	
  
                        background-­‐repeat	
  and	
  background-­‐posiVon,	
  use	
  
                        a	
  comma-­‐delimited	
  list	
  of	
  values	
  which	
  
                        correspond	
  to	
  the	
  individual	
  background	
  images
                        background-­‐image:	
  	
  	
  	
  	
  url(“image01.jpg”),	
  url(image02.jpg”);
                        background-­‐posiVon:	
  le	
  top,	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  right	
  boFom;
                        background-­‐repeat:	
  	
  	
  	
  repeat-­‐x,	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  no-­‐repeat;
                        background-­‐size:	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  250px,	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  cover;




Thursday, October 27, 2011
Shorthand Ain’t So Short
                        Background	
  shorthand	
  should  be  avoided	
  because	
  it	
  
                        resets	
  everything!
                           background-­‐color:	
  transparent;
                           background-­‐image:	
  none;
                           background-­‐posi0on:	
  0	
  0;
                           background-­‐size:	
  auto;	
  
                           background-­‐repeat:	
  repeat;
                           background-­‐clip:	
  border-­‐box;
                           background-­‐origin:	
  padding-­‐box;
                           background-­‐a8achment:	
  scroll;


Thursday, October 27, 2011
Alpha Gradients
                        Gradients	
  are	
  applied	
  to	
  an	
  element	
  as	
  a
                        background-­‐image
                        Create	
  an	
  rgba	
  or	
  hsla	
  black	
  or	
  white	
  gradients
                        Vary	
  the	
  opacity	
  instead	
  of	
  the	
  color	
  for	
  a	
  more	
  
                        so,	
  flexible	
  effect	
  that	
  can	
  be	
  applied	
  over	
  any	
  
                        color	
  on	
  the	
  page




Thursday, October 27, 2011
Combined Backgrounds




Thursday, October 27, 2011
Background Combined
            Background-­‐image	
  Gradient
                     Background-­‐color
                    Background-­‐image

              background-­‐color:	
  rgb(96,147,201);
              background-­‐image:	
  url(../images/
              santorini.jpg),	
  -­‐webkit-­‐linear-­‐gradient(top,	
  
              rgba(255,255,255,.7)	
  0%,rgba
              (255,255,255,0)	
  100%);
              background-­‐image:	
  url(../images/
              santorini.jpg),	
  -­‐moz-­‐linear-­‐gradient(top,	
  
              rgba(255,255,255,.7)	
  0%,rgba
              (255,255,255,0)	
  100%);
              background-­‐repeat:	
  no-­‐repeat,	
  repeat-­‐x;
              background-­‐posiVon:	
  center	
  boFom,	
  le	
  
              top;
              -­‐webkit-­‐background-­‐size:	
  contain,	
  250px;
              	
  	
  	
  	
  	
  -­‐moz-­‐background-­‐size:	
  contain,	
  250px;
              	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  background-­‐size:	
  contain,	
  250px;

Thursday, October 27, 2011
Pseudo-elements




Thursday, October 27, 2011
Pseudo-element selectors
                Also  called  generated  content
                       place	
  content	
  into	
  your	
  CSS	
  and	
  have	
  it	
  appear	
  in	
  HTML	
  
                       using	
  the	
  content	
  property
                       should	
  not	
  be	
  used	
  for	
  essenVal	
  content	
  
                       specify	
  where	
  it	
  should	
  appear,	
  :before	
  or	
  :aer	
  the	
  
                       content	
  of	
  the	
  element




                                         8+
Thursday, October 27, 2011
Pseudo-element selectors
                  generated  content
            .capVon:before	
  {	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
            	
  	
  	
  content:	
  “Figure:  “;
            	
  	
  	
  font-­‐weight:	
  bold;
            }
            <img	
  src=”img/baths.jpg>
            <p	
  class="capVon">The	
  Baths	
  at	
  Virgin	
  Gorda</p>




Thursday, October 27, 2011
We can create whole elements
                     div	
  {
                     	
  	
  	
  	
  	
  width:	
  700px;
                     	
  	
  	
  	
  	
  height:	
  400px;	
  
                     	
  	
  	
  	
  	
  posi8on:  rela8ve;
                     }
                     div:before,  div:aDer	
  {	
  	
  	
  	
  	
  	
  /*	
  the	
  common	
  proper0es	
  for	
  both	
  selectors	
  */
                     	
  	
  	
  	
  	
  content:"";
                     	
  	
  	
  	
    posi8on:  absolute;
                     }
                     div:before	
  {
                     	
  	
  	
  	
  	
  top:	
  25px;
                     	
  	
  	
  	
  	
  leU:	
  25px;
                     	
  	
  	
  	
  	
  right:	
  25px;
                     	
  	
  	
  	
  	
  bo8om:	
  25px;
                     }
                     div:aDer	
  {
                     	
  	
  	
  	
  	
  top:	
  50px;
                     	
  	
  	
  	
  	
  leU:	
  50px;
                     	
  	
  	
  	
  	
  right:	
  50px;
                     	
  	
  	
  	
  	
  bo8om:	
  50px;
                     }
Thursday, October 27, 2011
Every element gets two!




Thursday, October 27, 2011
Negative edge absolute positioning




Thursday, October 27, 2011
Pseudo-elements with buttons
                MulVple	
  layering	
  is	
  one	
  method	
  to	
  apply	
  mulVple	
  borders	
  on	
  
                buFons




Thursday, October 27, 2011
Create multiple wrappers




Thursday, October 27, 2011
Overlay gradients, borders & rgba




Thursday, October 27, 2011
Add decorative images
                .prof	
  .hd:before	
  {
                	
  	
  	
  	
  	
  content:	
  "";
                	
  	
  	
  	
  	
  posiVon:	
  absolute;
                	
  	
  	
  	
  	
  le:	
  -­‐15px;
                	
  	
  	
  	
  	
  top:	
  11px;
                	
  	
  	
  	
  	
  width:	
  16px;
                	
  	
  	
  	
  	
  height:	
  24px;
                	
  	
  	
  	
  	
  background:	
  url(../img/point.png)	
  no-­‐repeat	
  0	
  0;
                }




Thursday, October 27, 2011
Creating Shapes




Thursday, October 27, 2011
Border Tip
                        Borders	
  meet	
  with	
  diagonal
                        intersecVons
                        height:	
  0;
                        width:	
  0;
                        border-­‐width	
  determines
                        	
  	
  	
  size	
  of	
  the	
  triangle
                        vary	
  border	
  widths	
  to	
  change
                        	
  	
  	
  triangle	
  shape
                        use	
  transparency	
  on	
  3	
  sides




Thursday, October 27, 2011
border-radius
              Complete  circle:
              Width	
  and	
  height	
  are	
  equal
              Radius	
  equals	
  half	
  of	
  width/height	
  plus	
  full	
  padding
              Use	
  em	
  units	
  if	
  circle	
  contains	
  text
              .reminder	
  {
              	
  	
  	
  	
  	
  height:	
  9em;
              	
  	
  	
  	
  	
  width:	
  9em;
              	
  	
  	
  	
  	
  padding:	
  2em;
              	
   	
  	
  -­‐webkit-­‐border-­‐radius:	
  6.5em;
              	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐moz-­‐border-­‐radius:	
  6.5em
              	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  border-­‐radius:	
  6.5em;
              }
              Can	
  use	
  percentages	
  if	
  older	
  browser
              support	
  is	
  not	
  required:
              	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  border-­‐radius:	
  50%;


Thursday, October 27, 2011
border-radius
                Ellip-cal  corners:
                border-­‐radius:	
  x-­‐axis/y-­‐axis;
                First	
  value	
  extends	
  the	
  x-­‐axis	
  
                Second	
  value	
  extends	
  the	
  y-­‐axis

                -­‐webkit-­‐border-­‐radius:	
  100px/40px;
                	
  	
  	
  	
  	
  -­‐moz-­‐border-­‐radius:	
  100px/40px;
                	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  border-­‐radius:	
  100px/40px;




                (Safari	
  3	
  &	
  4	
  used	
  non-­‐standard:	
  
                border-­‐radius:	
  25px	
  10px;)



Thursday, October 27, 2011
transform
                Skewed  shapes:

                -­‐webkit-­‐transform:	
  skew(-­‐45deg);
                	
  	
  	
  	
  	
  -­‐moz-­‐transform:	
  skew(-­‐45deg);
                	
  	
  	
  	
  	
  	
  	
  -­‐ms-­‐transform:	
  skew(-­‐45deg);
                	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐o-­‐transform:	
  skew(-­‐45deg);
                	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  transform:	
  skew(-­‐45deg);




Thursday, October 27, 2011
The lowly square
                        You	
  can	
  do	
  this,	
  right?
                        element	
  {
                        	
  	
  	
  	
  	
  height:	
  150px;
                        	
  	
  	
  	
  	
  width:	
  150px;
                        }




Thursday, October 27, 2011
Shapes as
                             Pseudo-elements




Thursday, October 27, 2011
Add triangles
                        div:before	
  {
                        	
  	
  	
  	
  content:	
  "";
                        	
  	
  	
  	
  posiVon:	
  absolute;
                        	
  	
  	
  	
  height:	
  0;
                        	
  	
  	
  	
  width:	
  0;
                        	
  	
  	
  	
  le:	
  -­‐30px;
                        	
  	
  	
  	
  top:	
  30px;
                        	
  	
  	
  	
  border-­‐right:	
  30px	
  solid	
  skyblue;
                        	
  	
  	
  	
  border-­‐top:	
  15px	
  solid	
  transparent;
                        	
  	
  	
  	
  border-­‐boFom:	
  15px	
  solid	
  transparent;;	
  
                        }



Thursday, October 27, 2011
Triangles for ribbons
                        Pseudo-­‐element	
  triangles	
  added	
  as	
  the	
  top	
  and	
  
                        boFom	
  of	
  a	
  ribbon




Thursday, October 27, 2011
Speech bubbles
                        Round	
  pseudo-­‐elements
                        Absolutely	
  posiVoned	
  below
                        their	
  parent	
  element.
                        Or	
  overlapped	
  so	
  that	
  the	
  
                        top	
  pseudo-­‐element
                        obscures	
  a	
  porVon	
  of	
  the	
  lower




Thursday, October 27, 2011
Pulling the shapes together




Thursday, October 27, 2011
Box-shadow




Thursday, October 27, 2011
box-shadow as borders
                Syntax:
                values  -­‐  x  offset,  y  offset,  blur,  spread,  color

                box-­‐shadow:	
  
                	
  	
  	
  0	
  0	
  0	
  5px	
  #6CC,	
  
                	
  	
  	
  0	
  0	
  0	
  10px	
  #69C,	
  
                	
  	
  	
  0	
  0	
  0	
  15px	
  #66C,	
  
                	
  	
  	
  0	
  0	
  0	
  20px	
  #63C,
                	
  	
  	
  0	
  0	
  0	
  25px	
  #60C;

                Tips:
                Borders	
  are	
  placed
                on	
  elements	
  from	
  the
                inside	
  to	
  the	
  outside.


Thursday, October 27, 2011
box-shadow on one side only
                NegaVve	
  spread	
  value	
  can	
  be	
  used	
  to	
  make	
  the	
  box-­‐shadow	
  
                show	
  on	
  only	
  one	
  side	
  of	
  the	
  element.




Thursday, October 27, 2011
box-shadow on pseudo-elements
                Place	
  box-­‐shadows	
  on	
  pseudo-­‐elements	
  to	
  create	
  a
                variety	
  of	
  effects.
                .shadow:before	
  {
                	
  	
  	
  	
  	
  content:	
  “”;
                	
  	
  	
  	
  	
  posiVon:	
  absolute;
                	
  	
  	
  	
  	
  z-­‐index:-­‐1;
                	
  	
  	
  	
  	
  le:10px;
                	
  	
  	
  	
  	
  width:50%;
                	
  	
  	
  	
  	
  height:20%;
                	
  	
  	
  	
  	
  box-­‐shadow:0	
  15px	
  10px	
  rgba(0,	
  0,	
  0,	
  0.7);
                	
  	
  	
  	
  	
  transform:rotate(-­‐3deg);
                }
                (.shadow:aer	
  is	
  the	
  same,	
  but	
  reversed)


Thursday, October 27, 2011
box-shadow on pseudo-elements
                Nicolas	
  Gallagher’s	
  
                drop-­‐shadows	
  




Thursday, October 27, 2011
CSS Regions
                             & Exclusions




Thursday, October 27, 2011
CSS Regions
                        CSS	
  Regions	
  bring	
  new	
  properVes	
  to	
  CSS	
  that	
  
                        provide:
                          text	
  containers	
  with	
  custom	
  shapes.
                          exclusion	
  shapes	
  which	
  text	
  will	
  wrap	
  around.
                          text	
  that	
  flows	
  from	
  one	
  area	
  into	
  another.




Thursday, October 27, 2011
Single Thread




Thursday, October 27, 2011
Content Shape




Thursday, October 27, 2011
Dynamic Exclusion




Thursday, October 27, 2011
Thursday, October 27, 2011
Variables




Thursday, October 27, 2011
CSS Variables
                       “defines  a  new  type  of  primi8ve  value,  the  Variable,  
                     which  is  accepted  by  all  proper8es.”
                     @var  $header-­‐color	
  color	
  #000066;
                     @var  $link-­‐color	
  color	
  #0066CC;
                     @var  $secondary-­‐color	
  color	
  #CC0066;
                     a	
  {	
  color:	
  $link-­‐color;	
  }
                     a:visited	
  {	
  color:	
  $secondary-­‐color;	
  }
                     h1	
  {	
  
                     	
  	
  color:	
  $header-­‐color;
                     	
  	
  background-­‐image:	
  
                     	
  	
  	
  	
  	
  	
  	
  	
  linear-­‐gradient(leU,	
  $main-­‐color,	
  transparent	
  25%);
                     }


Thursday, October 27, 2011
Mixins (not accepted yet)
                     Mixins  are  blocks  of  rules  that  can  be  "mixed  in"  with  normal  
                     blocks  of  rules.
                     @mixin  ‘alert’	
  {
                     	
  	
  	
  	
  background:	
  #FF0000;
                     	
  	
  	
  	
  color:	
  #FFFFF;
                     	
  	
  	
  	
  text-­‐shadow:	
  0	
  0	
  3px	
  rgba(0,0,0,0.4);
                     	
  	
  	
  	
  anima0on:	
  ‘a8en0ongrab’	
  300ms;
                     }
                     input:invalid:focus:aUer	
  {
                     	
  	
  	
  	
  	
  content:	
  “INVALID”;	
  	
  
                     	
  	
  	
  	
  	
  @mixin  ‘alert’;
                     }
                     .alert	
  {
                     	
  	
  	
  	
  	
  @mixin  ‘alert’;
                     	
  	
  	
  	
  	
  text-­‐decora0on:	
  underline;
                     }


Thursday, October 27, 2011
CSS Filters




Thursday, October 27, 2011
CSS Filters
                        A	
  filter	
  effect	
  consists	
  of	
  a	
  series	
  of	
  graphics	
  
                        operaVons	
  that	
  are	
  applied	
  to	
  a	
  given	
  source	
  
                        graphic	
  (client-­‐side)	
  to	
  produce	
  a	
  modified	
  
                        graphical	
  result.	
  
                        The	
  result	
  of	
  the	
  filter	
  effect	
  is	
  rendered	
  to	
  the	
  
                        target	
  device	
  instead	
  of	
  the	
  original	
  source	
  
                        graphic.
                        Based	
  on	
  SVG	
  filters.




Thursday, October 27, 2011
Example filters
                        greyscale(amount)
                        sepia(amount)
                        saturate(amount)
                        hue-­‐rotate(angle)
                        invert(amount)
                        opacity(amount)
                        gamma(amplitude	
  exponent	
  offset)
                        blur(radiusX	
  radiusY)
                        sharpen(amount	
  radius	
  threshold)
                        drop-­‐shadow(<shadow>)

Thursday, October 27, 2011
Also being considered...
                  brightness,	
  contrast,	
               crop(x,	
  y,	
  w,	
  h)
                  exposure                                 bloom(radius,	
  intensity)
                  halUone                                  gloom(radius,	
  intensity)
                  mo0on-­‐blur(radius,	
  angle)           mosaic(w,h)
                  posterize(levels)                        displace(url,	
  intensity)
                  bump(x,	
  y,	
  radius,	
  intensity)   edge-­‐detect(intensity)
                  generators                               pinch(x,	
  y,	
  radius,	
  scale)
                  circle-­‐crop(x,	
  y,	
  radius)        twirl(x,	
  y,	
  radius,	
  angle)
                  affine-­‐transform(some	
  
                  matrix)



Thursday, October 27, 2011
Thank you!




Thursday, October 27, 2011
Resources
                  w3conversions.com/resources.html
                  FleeVng	
  Epiphanies	
  -­‐	
  My	
  blog
                  Box	
  shadow	
  on	
  one	
  side	
  blog	
  post
                  CSS	
  background-­‐size	
  property	
  at	
  .netmagazine
                  Create	
  flexible	
  imagery	
  for	
  the	
  web	
  -­‐	
  Computer	
  Arts
                  Mastering	
  CSS	
  with	
  Dreamweaver	
  CS4	
  
                  [New	
  Riders	
  Voices	
  that	
  MaFer]
                  Stephanie	
  Sullivan	
  &	
  Greg	
  Rewis
                  twiFer:	
  @stefsull
                  stef@w3conversions.com



Thursday, October 27, 2011

Más contenido relacionado

Similar a Stephanie Rewis - css-startech

Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondAndy Stratton
 
Squishy pixels
Squishy pixelsSquishy pixels
Squishy pixelsFITC
 
Progressive EEnhancement [EECI 2011]
Progressive EEnhancement [EECI 2011]Progressive EEnhancement [EECI 2011]
Progressive EEnhancement [EECI 2011]Aaron Gustafson
 
Discovering Your AI Super Powers - Tips and Tricks to Jumpstart your AI Projects
Discovering Your AI Super Powers - Tips and Tricks to Jumpstart your AI ProjectsDiscovering Your AI Super Powers - Tips and Tricks to Jumpstart your AI Projects
Discovering Your AI Super Powers - Tips and Tricks to Jumpstart your AI ProjectsWee Hyong Tok
 
Intro to HTML5 Game Programming
Intro to HTML5 Game ProgrammingIntro to HTML5 Game Programming
Intro to HTML5 Game ProgrammingJames Williams
 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Pascal Rettig
 
Using mvvm on the web using knockoutjs & ignite ui
Using mvvm on the web using knockoutjs & ignite uiUsing mvvm on the web using knockoutjs & ignite ui
Using mvvm on the web using knockoutjs & ignite uiNish Anil
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryAndrea Verlicchi
 
How to develop a CSS Framework
How to develop a CSS FrameworkHow to develop a CSS Framework
How to develop a CSS FrameworkOlivier Besson
 
CSS & eCSStender [CSS Summit 2011]
CSS & eCSStender [CSS Summit 2011]CSS & eCSStender [CSS Summit 2011]
CSS & eCSStender [CSS Summit 2011]Aaron Gustafson
 
Web Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosWeb Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosMatteo Papadopoulos
 
Wordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The NextwebWordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The NextwebGeorge Kanellopoulos
 
Devoxx 2009: The Lift Framework
Devoxx 2009: The Lift FrameworkDevoxx 2009: The Lift Framework
Devoxx 2009: The Lift FrameworkTimothy Perrett
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeAcquia
 
CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong? CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong? Russ Weakley
 

Similar a Stephanie Rewis - css-startech (20)

slides-students-C04.pdf
slides-students-C04.pdfslides-students-C04.pdf
slides-students-C04.pdf
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and Beyond
 
Squishy pixels
Squishy pixelsSquishy pixels
Squishy pixels
 
Html5 more than just html5 v final
Html5  more than just html5 v finalHtml5  more than just html5 v final
Html5 more than just html5 v final
 
Progressive EEnhancement [EECI 2011]
Progressive EEnhancement [EECI 2011]Progressive EEnhancement [EECI 2011]
Progressive EEnhancement [EECI 2011]
 
Discovering Your AI Super Powers - Tips and Tricks to Jumpstart your AI Projects
Discovering Your AI Super Powers - Tips and Tricks to Jumpstart your AI ProjectsDiscovering Your AI Super Powers - Tips and Tricks to Jumpstart your AI Projects
Discovering Your AI Super Powers - Tips and Tricks to Jumpstart your AI Projects
 
Intro to HTML5 Game Programming
Intro to HTML5 Game ProgrammingIntro to HTML5 Game Programming
Intro to HTML5 Game Programming
 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3
 
Using mvvm on the web using knockoutjs & ignite ui
Using mvvm on the web using knockoutjs & ignite uiUsing mvvm on the web using knockoutjs & ignite ui
Using mvvm on the web using knockoutjs & ignite ui
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQuery
 
Css framework
Css frameworkCss framework
Css framework
 
How to develop a CSS Framework
How to develop a CSS FrameworkHow to develop a CSS Framework
How to develop a CSS Framework
 
Css framework
Css frameworkCss framework
Css framework
 
CSS & eCSStender [CSS Summit 2011]
CSS & eCSStender [CSS Summit 2011]CSS & eCSStender [CSS Summit 2011]
CSS & eCSStender [CSS Summit 2011]
 
Web Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosWeb Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaos
 
Wordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The NextwebWordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The Nextweb
 
Devoxx 2009: The Lift Framework
Devoxx 2009: The Lift FrameworkDevoxx 2009: The Lift Framework
Devoxx 2009: The Lift Framework
 
CSS 3
CSS 3CSS 3
CSS 3
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
 
CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong? CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong?
 

Más de StarTech Conference

Mike hostetler - jQuery knowledge append to you
Mike hostetler - jQuery knowledge append to youMike hostetler - jQuery knowledge append to you
Mike hostetler - jQuery knowledge append to youStarTech Conference
 
Stephen Anderson - Como construimos e hicimos crecer una empresa de consultor...
Stephen Anderson - Como construimos e hicimos crecer una empresa de consultor...Stephen Anderson - Como construimos e hicimos crecer una empresa de consultor...
Stephen Anderson - Como construimos e hicimos crecer una empresa de consultor...StarTech Conference
 
Scott Chacon - Cuento de tres árboles
Scott Chacon - Cuento de tres árbolesScott Chacon - Cuento de tres árboles
Scott Chacon - Cuento de tres árbolesStarTech Conference
 
Robert Nyman - HTML5 apis where no man has gone before startechconf
Robert Nyman - HTML5 apis where no man has gone before startechconfRobert Nyman - HTML5 apis where no man has gone before startechconf
Robert Nyman - HTML5 apis where no man has gone before startechconfStarTech Conference
 
Markos calderon lecciones aprendidas del desarrollo de un sistema de web co...
Markos calderon   lecciones aprendidas del desarrollo de un sistema de web co...Markos calderon   lecciones aprendidas del desarrollo de un sistema de web co...
Markos calderon lecciones aprendidas del desarrollo de un sistema de web co...StarTech Conference
 
Ravi Mynampaty - developing findability standards
Ravi Mynampaty - developing findability standardsRavi Mynampaty - developing findability standards
Ravi Mynampaty - developing findability standardsStarTech Conference
 
Charles nutter star techconf 2011 - jvm languages
Charles nutter   star techconf 2011 - jvm languagesCharles nutter   star techconf 2011 - jvm languages
Charles nutter star techconf 2011 - jvm languagesStarTech Conference
 
Abraham Barrera - dev-cross-mobile
Abraham Barrera - dev-cross-mobileAbraham Barrera - dev-cross-mobile
Abraham Barrera - dev-cross-mobileStarTech Conference
 
Eduardo Silva - monkey http-server everywhere
Eduardo Silva - monkey http-server everywhereEduardo Silva - monkey http-server everywhere
Eduardo Silva - monkey http-server everywhereStarTech Conference
 
Rey Bango - HTML5: polyfills and shims
Rey Bango -  HTML5: polyfills and shimsRey Bango -  HTML5: polyfills and shims
Rey Bango - HTML5: polyfills and shimsStarTech Conference
 
Tom Preston Werner - Optimize for happiness
Tom Preston Werner -  Optimize for happinessTom Preston Werner -  Optimize for happiness
Tom Preston Werner - Optimize for happinessStarTech Conference
 
Mark ramm To relate or not to relate
Mark ramm   To relate or not to relateMark ramm   To relate or not to relate
Mark ramm To relate or not to relateStarTech Conference
 

Más de StarTech Conference (19)

Mike hostetler - jQuery knowledge append to you
Mike hostetler - jQuery knowledge append to youMike hostetler - jQuery knowledge append to you
Mike hostetler - jQuery knowledge append to you
 
Luis Meijueiro - Open Data
Luis Meijueiro - Open DataLuis Meijueiro - Open Data
Luis Meijueiro - Open Data
 
Stephen Anderson - Como construimos e hicimos crecer una empresa de consultor...
Stephen Anderson - Como construimos e hicimos crecer una empresa de consultor...Stephen Anderson - Como construimos e hicimos crecer una empresa de consultor...
Stephen Anderson - Como construimos e hicimos crecer una empresa de consultor...
 
Jonathan snook - fake-it
Jonathan snook - fake-itJonathan snook - fake-it
Jonathan snook - fake-it
 
Scott Chacon - Cuento de tres árboles
Scott Chacon - Cuento de tres árbolesScott Chacon - Cuento de tres árboles
Scott Chacon - Cuento de tres árboles
 
T.Pollak y C.Yaconi - Prey
T.Pollak y C.Yaconi - PreyT.Pollak y C.Yaconi - Prey
T.Pollak y C.Yaconi - Prey
 
Jano Gonzalez - jruby
Jano Gonzalez - jrubyJano Gonzalez - jruby
Jano Gonzalez - jruby
 
Pedro Fuentes - star techconf
Pedro Fuentes - star techconfPedro Fuentes - star techconf
Pedro Fuentes - star techconf
 
Robert Nyman - HTML5 apis where no man has gone before startechconf
Robert Nyman - HTML5 apis where no man has gone before startechconfRobert Nyman - HTML5 apis where no man has gone before startechconf
Robert Nyman - HTML5 apis where no man has gone before startechconf
 
Markos calderon lecciones aprendidas del desarrollo de un sistema de web co...
Markos calderon   lecciones aprendidas del desarrollo de un sistema de web co...Markos calderon   lecciones aprendidas del desarrollo de un sistema de web co...
Markos calderon lecciones aprendidas del desarrollo de un sistema de web co...
 
Ravi Mynampaty - developing findability standards
Ravi Mynampaty - developing findability standardsRavi Mynampaty - developing findability standards
Ravi Mynampaty - developing findability standards
 
Charles nutter star techconf 2011 - jvm languages
Charles nutter   star techconf 2011 - jvm languagesCharles nutter   star techconf 2011 - jvm languages
Charles nutter star techconf 2011 - jvm languages
 
Caridy patino - node-js
Caridy patino - node-jsCaridy patino - node-js
Caridy patino - node-js
 
Abraham Barrera - dev-cross-mobile
Abraham Barrera - dev-cross-mobileAbraham Barrera - dev-cross-mobile
Abraham Barrera - dev-cross-mobile
 
Eduardo Silva - monkey http-server everywhere
Eduardo Silva - monkey http-server everywhereEduardo Silva - monkey http-server everywhere
Eduardo Silva - monkey http-server everywhere
 
Rey Bango - HTML5: polyfills and shims
Rey Bango -  HTML5: polyfills and shimsRey Bango -  HTML5: polyfills and shims
Rey Bango - HTML5: polyfills and shims
 
Tom Preston Werner - Optimize for happiness
Tom Preston Werner -  Optimize for happinessTom Preston Werner -  Optimize for happiness
Tom Preston Werner - Optimize for happiness
 
Mark ramm To relate or not to relate
Mark ramm   To relate or not to relateMark ramm   To relate or not to relate
Mark ramm To relate or not to relate
 
Greg rewis move-itsession
Greg rewis move-itsessionGreg rewis move-itsession
Greg rewis move-itsession
 

Último

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
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
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
"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
 

Último (20)

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
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
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
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
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
"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
 

Stephanie Rewis - css-startech

  • 1. CSS3 The  web’s  Swiss  Army  Knife  updated  and  improved Thursday, October 27, 2011
  • 2. Stephanie (Sullivan) Rewis Front-­‐end  developer Principal  w3conversions.com Wrote  the  CSS  Layouts  in  Dreamweaver WaSP  corporate  liaison  to  Adobe Customized  corporate  training  &  mentoring Author  &  Speaker TwiFer  addict  (@stefsull) Thursday, October 27, 2011
  • 3. If  we  use  these  techniques  right  [HTML  and  CSS3],   we  can  get  rid  of  half  of  the  images  on  the  web,   because  they're  used  for  styling. —  Håkon  Wium  Lie Thursday, October 27, 2011
  • 4. Benefits of CSS3 Reduced  development  and  maintenance  0me   Increased  usability  &  accessibility Be8er  search  engine  placement  due  to  real  text  and   faster  pages Op0mized  styles  based  on  device  capabili0es Increased  page  performance Reducing  the  number  of  HTTP  requests...is  the  most   important  guideline  for  improving  performance  for  first   0me  visitors. Yahoo!  Excep,onal  Performance  Team,   h8p://developer.yahoo.com/performance/rules.html Thursday, October 27, 2011
  • 5. CSS is Modular It  will  never  be  done Modules  are  in  varied   states  of  compleVon Thursday, October 27, 2011
  • 6. CSS3 Prefixes You  can  use  it  today— but  know  your  prefixes -­‐moz-­‐  Mozilla   (Gecko  browsers) -­‐webkit-­‐  Safari   (plus  WebKit  browsers) -­‐o-­‐  Opera  Soware -­‐ms-­‐  Microso -­‐khtml-­‐  Konqueror   browser  (plus  Safari  1) Thursday, October 27, 2011
  • 7. When Can I Use... CompaVbility  tables  for  features  in  HTML5,  CSS3,   SVG  and  other  upcoming  web  technologies Thursday, October 27, 2011
  • 8. Modernizr — My Hero! hFp://www.modernizr.com Feature-­‐detecVon  library  for  HTML5  and  CSS3 Modernizr  creates  the  HTML5  elements  in  the  DOM Thursday, October 27, 2011
  • 9. Modernizr - Feature Detection Link  to  the  script  &  add  <html  class=”no-­‐js”> Modernizr  changes  the  no-­‐js  class  to  a  long  string   of  classes  that  you  can  use  to  serve  different  CSS   or  JS  to  a  browser  depending  on  its  lack  of   capabiliVes.  ie: <html  class=”  js  canvas  canvastext  geolocaVon   crosswindowmessaging  no-­‐websqldatabase  no-­‐indexeddb   hashchange  no-­‐historymanagement  draganddrop  no-­‐websockets   rgba  hsla  mulVplebgs  backgroundsize  borderimage  borderradius   boxshadow  opacity  no-­‐cssanimaVons  csscolumns  cssgradients  no-­‐ cssreflec8ons  csstransforms  no-­‐csstransforms3d  no-­‐csstransi8ons   video  audio  localstorage  sessionstorage  webworkers   applicaVoncache  svg  no-­‐smilsvgclippaths  foniace”> Thursday, October 27, 2011
  • 10. CSS based on abilities Write  CSS  for  browsers  missing  support: .no-­‐cssgradients  .element  {        background-­‐color:  #value;      /*or*/        background-­‐image:  url(img/gradient.jpg); } Or  write  CSS  so  it’s  only  shown  to  capable   browsers: .  cssgradients  .element  {          background-­‐image:  -­‐webkit,  -­‐moz,  -­‐ms,  -­‐o,  etc; } Thursday, October 27, 2011
  • 12. Three Boxes (Box Model) border Thursday, October 27, 2011
  • 13. background-position (CSS3) Four  values  are  now  possible: boFom    10px    le    -­‐15px x-­‐axis y-­‐axis boFom    10px    le    -­‐15px Thursday, October 27, 2011
  • 14. background-repeat (CSS3) Double  values  can  now  be  used: x-­‐axis y-­‐axis background-­‐repeat:  repeat  no-­‐repeat; Using  a  single  “repeat”  assumes  a  repeat  in  both   direcVons. Two  new  values: space  -­‐  repeat  as  many  Vmes  as  will  fit  with  equal   spacing  between  images round  -­‐  rescales  the  image  so  it   fits  an  equal  number  of  Vmes Thursday, October 27, 2011
  • 15. Flexible Control New  levels  of  control  with  new  combinaVons background-­‐repeat:  no-­‐repeat  space; background-­‐repeat:  space  round; Thursday, October 27, 2011
  • 16. background-origin Background-­‐origin  specifies  the  star-ng  point  for  the  background   image border-­‐box  -­‐  posiVons  the   background  image  relaVve   to  the  outer  edge  of  the  border padding-­‐box  (default)  -­‐  posiVons   the  background  image  relaVve   to  the  outer  edge  of  the  padding   (inner  edge  of  the  border) content-­‐box  -­‐  posiVons  the   background  image  relaVve  to   the  outer  edge  of  the  content   (inner  edge  of  the  padding) Thursday, October 27, 2011
  • 17. background-clip Background-­‐clip  hides  a  porVon  of  your  background border-­‐box  (default)  -­‐  clips   backgrounds  relaVve  to  the  outer   edge  of  the  border padding-­‐box  -­‐  clips  backgrounds   relaVve  to  the  outer  edge  of  the   padding  (inner  edge  of  the  border) content-­‐box  -­‐  clips  backgrounds   relaVve  to  the  outer  edge  of  the   content  (inner  edge  of  the   padding) Thursday, October 27, 2011
  • 18. background-size Background-­‐size  lets  you  specify  the  size  of  a  background  image  —   either  as  a  fixed  value,  or  relaVve  to  the  background  posi0oning   area pixels  -­‐  define  one  or  both  values percents  -­‐  define  one  or  both  values cover  -­‐  covers  the  enVre  space  using  the  lesser  width  or  height.   Warning:  Clipping  may  occur. contain  -­‐  shows  the  enVre  image  based  on  the  greater  height   or  width  of  the  image.  This  means  the  image  may  not   completely  fill  the  background  posiVoning  area. When  using  cover/contain  on  the  body  element,  set  the  height   of  the  html  element  to  100% Thursday, October 27, 2011
  • 20. .freshest { /* contains awning background */ ! width: 33.375em; ! background-size: 100% auto; /* this allows the background image to scale on the x-axis WITH larger text sizes */ ! font-size: 1em; } .homeLogo { /* logo base of the vege stand */ ! width: 33.75em; ! ! height: 18.75em; ! font-size: 1em; /* this causes image in the page to scale up as well */ ! -ms-interpolation-mode: bicubic; /* this helps IE to play nice when scaling */ } .navMain li { /* vege baskets */ ! height: 11.25em; ! background-size: 100% 100%; /* this allows navigation images to scale both directions WITH larger text */ } Thursday, October 27, 2011
  • 21. More Images - More Better Syntax  (comma  separated): background-­‐image:  url(“image01.jpg”),  url(image02.jpg”); Subsequent  background  properVes,  such  as   background-­‐repeat  and  background-­‐posiVon,  use   a  comma-­‐delimited  list  of  values  which   correspond  to  the  individual  background  images background-­‐image:          url(“image01.jpg”),  url(image02.jpg”); background-­‐posiVon:  le  top,                                          right  boFom; background-­‐repeat:        repeat-­‐x,                                      no-­‐repeat; background-­‐size:                    250px,                                              cover; Thursday, October 27, 2011
  • 22. Shorthand Ain’t So Short Background  shorthand  should  be  avoided  because  it   resets  everything! background-­‐color:  transparent; background-­‐image:  none; background-­‐posi0on:  0  0; background-­‐size:  auto;   background-­‐repeat:  repeat; background-­‐clip:  border-­‐box; background-­‐origin:  padding-­‐box; background-­‐a8achment:  scroll; Thursday, October 27, 2011
  • 23. Alpha Gradients Gradients  are  applied  to  an  element  as  a background-­‐image Create  an  rgba  or  hsla  black  or  white  gradients Vary  the  opacity  instead  of  the  color  for  a  more   so,  flexible  effect  that  can  be  applied  over  any   color  on  the  page Thursday, October 27, 2011
  • 25. Background Combined Background-­‐image  Gradient Background-­‐color Background-­‐image background-­‐color:  rgb(96,147,201); background-­‐image:  url(../images/ santorini.jpg),  -­‐webkit-­‐linear-­‐gradient(top,   rgba(255,255,255,.7)  0%,rgba (255,255,255,0)  100%); background-­‐image:  url(../images/ santorini.jpg),  -­‐moz-­‐linear-­‐gradient(top,   rgba(255,255,255,.7)  0%,rgba (255,255,255,0)  100%); background-­‐repeat:  no-­‐repeat,  repeat-­‐x; background-­‐posiVon:  center  boFom,  le   top; -­‐webkit-­‐background-­‐size:  contain,  250px;          -­‐moz-­‐background-­‐size:  contain,  250px;                              background-­‐size:  contain,  250px; Thursday, October 27, 2011
  • 27. Pseudo-element selectors Also  called  generated  content place  content  into  your  CSS  and  have  it  appear  in  HTML   using  the  content  property should  not  be  used  for  essenVal  content   specify  where  it  should  appear,  :before  or  :aer  the   content  of  the  element 8+ Thursday, October 27, 2011
  • 28. Pseudo-element selectors generated  content .capVon:before  {                                      content:  “Figure:  “;      font-­‐weight:  bold; } <img  src=”img/baths.jpg> <p  class="capVon">The  Baths  at  Virgin  Gorda</p> Thursday, October 27, 2011
  • 29. We can create whole elements div  {          width:  700px;          height:  400px;            posi8on:  rela8ve; } div:before,  div:aDer  {            /*  the  common  proper0es  for  both  selectors  */          content:"";          posi8on:  absolute; } div:before  {          top:  25px;          leU:  25px;          right:  25px;          bo8om:  25px; } div:aDer  {          top:  50px;          leU:  50px;          right:  50px;          bo8om:  50px; } Thursday, October 27, 2011
  • 30. Every element gets two! Thursday, October 27, 2011
  • 31. Negative edge absolute positioning Thursday, October 27, 2011
  • 32. Pseudo-elements with buttons MulVple  layering  is  one  method  to  apply  mulVple  borders  on   buFons Thursday, October 27, 2011
  • 34. Overlay gradients, borders & rgba Thursday, October 27, 2011
  • 35. Add decorative images .prof  .hd:before  {          content:  "";          posiVon:  absolute;          le:  -­‐15px;          top:  11px;          width:  16px;          height:  24px;          background:  url(../img/point.png)  no-­‐repeat  0  0; } Thursday, October 27, 2011
  • 37. Border Tip Borders  meet  with  diagonal intersecVons height:  0; width:  0; border-­‐width  determines      size  of  the  triangle vary  border  widths  to  change      triangle  shape use  transparency  on  3  sides Thursday, October 27, 2011
  • 38. border-radius Complete  circle: Width  and  height  are  equal Radius  equals  half  of  width/height  plus  full  padding Use  em  units  if  circle  contains  text .reminder  {          height:  9em;          width:  9em;          padding:  2em;      -­‐webkit-­‐border-­‐radius:  6.5em;                          -­‐moz-­‐border-­‐radius:  6.5em                                              border-­‐radius:  6.5em; } Can  use  percentages  if  older  browser support  is  not  required:                                            border-­‐radius:  50%; Thursday, October 27, 2011
  • 39. border-radius Ellip-cal  corners: border-­‐radius:  x-­‐axis/y-­‐axis; First  value  extends  the  x-­‐axis   Second  value  extends  the  y-­‐axis -­‐webkit-­‐border-­‐radius:  100px/40px;          -­‐moz-­‐border-­‐radius:  100px/40px;                              border-­‐radius:  100px/40px; (Safari  3  &  4  used  non-­‐standard:   border-­‐radius:  25px  10px;) Thursday, October 27, 2011
  • 40. transform Skewed  shapes: -­‐webkit-­‐transform:  skew(-­‐45deg);          -­‐moz-­‐transform:  skew(-­‐45deg);              -­‐ms-­‐transform:  skew(-­‐45deg);                    -­‐o-­‐transform:  skew(-­‐45deg);                              transform:  skew(-­‐45deg); Thursday, October 27, 2011
  • 41. The lowly square You  can  do  this,  right? element  {          height:  150px;          width:  150px; } Thursday, October 27, 2011
  • 42. Shapes as Pseudo-elements Thursday, October 27, 2011
  • 43. Add triangles div:before  {        content:  "";        posiVon:  absolute;        height:  0;        width:  0;        le:  -­‐30px;        top:  30px;        border-­‐right:  30px  solid  skyblue;        border-­‐top:  15px  solid  transparent;        border-­‐boFom:  15px  solid  transparent;;   } Thursday, October 27, 2011
  • 44. Triangles for ribbons Pseudo-­‐element  triangles  added  as  the  top  and   boFom  of  a  ribbon Thursday, October 27, 2011
  • 45. Speech bubbles Round  pseudo-­‐elements Absolutely  posiVoned  below their  parent  element. Or  overlapped  so  that  the   top  pseudo-­‐element obscures  a  porVon  of  the  lower Thursday, October 27, 2011
  • 46. Pulling the shapes together Thursday, October 27, 2011
  • 48. box-shadow as borders Syntax: values  -­‐  x  offset,  y  offset,  blur,  spread,  color box-­‐shadow:        0  0  0  5px  #6CC,        0  0  0  10px  #69C,        0  0  0  15px  #66C,        0  0  0  20px  #63C,      0  0  0  25px  #60C; Tips: Borders  are  placed on  elements  from  the inside  to  the  outside. Thursday, October 27, 2011
  • 49. box-shadow on one side only NegaVve  spread  value  can  be  used  to  make  the  box-­‐shadow   show  on  only  one  side  of  the  element. Thursday, October 27, 2011
  • 50. box-shadow on pseudo-elements Place  box-­‐shadows  on  pseudo-­‐elements  to  create  a variety  of  effects. .shadow:before  {          content:  “”;          posiVon:  absolute;          z-­‐index:-­‐1;          le:10px;          width:50%;          height:20%;          box-­‐shadow:0  15px  10px  rgba(0,  0,  0,  0.7);          transform:rotate(-­‐3deg); } (.shadow:aer  is  the  same,  but  reversed) Thursday, October 27, 2011
  • 51. box-shadow on pseudo-elements Nicolas  Gallagher’s   drop-­‐shadows   Thursday, October 27, 2011
  • 52. CSS Regions & Exclusions Thursday, October 27, 2011
  • 53. CSS Regions CSS  Regions  bring  new  properVes  to  CSS  that   provide: text  containers  with  custom  shapes. exclusion  shapes  which  text  will  wrap  around. text  that  flows  from  one  area  into  another. Thursday, October 27, 2011
  • 59. CSS Variables  “defines  a  new  type  of  primi8ve  value,  the  Variable,   which  is  accepted  by  all  proper8es.” @var  $header-­‐color  color  #000066; @var  $link-­‐color  color  #0066CC; @var  $secondary-­‐color  color  #CC0066; a  {  color:  $link-­‐color;  } a:visited  {  color:  $secondary-­‐color;  } h1  {      color:  $header-­‐color;    background-­‐image:                  linear-­‐gradient(leU,  $main-­‐color,  transparent  25%); } Thursday, October 27, 2011
  • 60. Mixins (not accepted yet) Mixins  are  blocks  of  rules  that  can  be  "mixed  in"  with  normal   blocks  of  rules. @mixin  ‘alert’  {        background:  #FF0000;        color:  #FFFFF;        text-­‐shadow:  0  0  3px  rgba(0,0,0,0.4);        anima0on:  ‘a8en0ongrab’  300ms; } input:invalid:focus:aUer  {          content:  “INVALID”;              @mixin  ‘alert’; } .alert  {          @mixin  ‘alert’;          text-­‐decora0on:  underline; } Thursday, October 27, 2011
  • 62. CSS Filters A  filter  effect  consists  of  a  series  of  graphics   operaVons  that  are  applied  to  a  given  source   graphic  (client-­‐side)  to  produce  a  modified   graphical  result.   The  result  of  the  filter  effect  is  rendered  to  the   target  device  instead  of  the  original  source   graphic. Based  on  SVG  filters. Thursday, October 27, 2011
  • 63. Example filters greyscale(amount) sepia(amount) saturate(amount) hue-­‐rotate(angle) invert(amount) opacity(amount) gamma(amplitude  exponent  offset) blur(radiusX  radiusY) sharpen(amount  radius  threshold) drop-­‐shadow(<shadow>) Thursday, October 27, 2011
  • 64. Also being considered... brightness,  contrast,   crop(x,  y,  w,  h) exposure bloom(radius,  intensity) halUone gloom(radius,  intensity) mo0on-­‐blur(radius,  angle) mosaic(w,h) posterize(levels) displace(url,  intensity) bump(x,  y,  radius,  intensity) edge-­‐detect(intensity) generators pinch(x,  y,  radius,  scale) circle-­‐crop(x,  y,  radius) twirl(x,  y,  radius,  angle) affine-­‐transform(some   matrix) Thursday, October 27, 2011
  • 66. Resources w3conversions.com/resources.html FleeVng  Epiphanies  -­‐  My  blog Box  shadow  on  one  side  blog  post CSS  background-­‐size  property  at  .netmagazine Create  flexible  imagery  for  the  web  -­‐  Computer  Arts Mastering  CSS  with  Dreamweaver  CS4   [New  Riders  Voices  that  MaFer] Stephanie  Sullivan  &  Greg  Rewis twiFer:  @stefsull stef@w3conversions.com Thursday, October 27, 2011