SlideShare a Scribd company logo
1 of 78
hello.
Rachel Andrew

    @rachelandrew

   rachelandrew.co.uk
   edgeofmyseat.com
     grabaperch.com
CSS 3
CSS3 is the next
 version of CSS
CSS3 is Modular
Some CSS3 modules
 are more complete
     than others
W3C Maturity Levels
Working Draft
Candidate Recommendation
Proposed Recommendation
W3C Recommendation
http://www.w3.org/2005/10/Process-20051014/tr#maturity-levels
CSS3 is supported by
      browsers

 Some browsers and some (parts of) modules.
Vendor-speci c
  extensions

 Implementing early stage CSS3
border-radius
border-radius
.box {
   -moz-border-radius: 10px;
   -webkit-border-radius: 10px;
   border-radius: 10px;
 }
In defence of vendor-
  speci c extensions
Using CSS3
Selectors module

   W3C Proposed Recommendation
 http://www.w3.org/TR/css3-selectors/
The problem with
    CSS2 selectors
                     Not precise
                   Led to “classitis”
If we can’t access mark-up it is hard to target things
CSS3 Selectors
           “Common sense” new selectors
target elements more precisely without adding classes
rst-child

target an element when it is the first child of a parent
                     element
rst-child
rst-child

div#wrapper p:first-child {

 
 font-size: 1.5em;
}
rst-child
last-child

target an element when it is the last child of a parent
                     element
last-child
last-child

ul#navigation li:last-child {

 
 border-bottom: none;
}
last-child
nth-child

select multiple elements according to their position in
                   the document tree
nth-child
nth-child

tr:nth-child(odd) td {

 
 background-color: #f0e9c5;
}
nth-child
nth-child

tr:nth-child(2n+1) td {

 
 background-color: #f0e9c5;
}


   http://reference.sitepoint.com/css/understandingnthchildexpressions
Adjacent Sibling

div#wrapper h1 + p {

 font-size: 1.5em;
}
Adjacent Sibling
Attribute Selectors

form input[type="text"] {

}

form input[type="submit"] {

}
Attribute Selectors
Attribute Selectors
label[for="fContact"] {
    
 float: none;
    
 width: auto;
}

a[href ^="mailto:"] {

 
 padding-right: 20px;

 
 background-image:url(email.png);

 
 background-repeat: no-repeat;

 
 background-position: right center;
}
Browser
Support
Browser Support
Does it
matter?
Yes, it
matters.
JavaScript

Plug the holes in browser support using JavaScript.
jQuery: rst-child
div#wrapper p:first-child,
div#wrapper p.first {

 
 font-size: 1.5em;
}




<script src="http://code.jquery.com/jquery-latest.js"></
script>
<script>
  $(document).ready(function(){

 $("div#wrapper p:first-child").addClass("first");
  });
</script>
jQuery: last-child
ul#navigation li:last-child, ul#navigation li.last {

 
 border-bottom: none;
}




<script src="http://code.jquery.com/jquery-latest.js"></
script>
<script>
  $(document).ready(function(){

 $("ul#navigation li:last-child").addClass("last");
  });
</script>
jQuery: nth-child
tr:nth-child(odd) td, td.odd {

 background-color: #f0e9c5;
}




<script src="http://code.jquery.com/jquery-latest.js"></
script>
<script>
  $(document).ready(function(){

 $("tr:nth-child(odd) td").addClass("odd");
  });
</script>
Scripts that “ x IE”

 http://www.keithclark.co.uk/labs/ie-css3/
          http://ecsstender.org
Color module

         Working Draft
http://www.w3.org/TR/css3-color/
opacity

specify the opacity of an element
opacity
opacity
ul#gallery li {

 
 opacity: 0.4;
}

ul#gallery li:hover {

 
 opacity: 1;
}
RGBA

specify the opacity of a colour with ‘alpha’
RGBA
RGBA

div#feature .caption {
    background-color: rgba(255,255,255,0.5);
}
24ways.org
Browser
Support?
Fonts module

         Working Draft
http://www.w3.org/TR/css3-fonts/
@font-face

using a font other than one installed on your user’s
                     computer
@font-face
@font-face {
  
 ont-family: KaffeesatzBold;
  f
  
 rc: url(YanoneKaffeesatz-
  s
Bold.ttf);
}

h1 {

 font-family: KaffeesatzBold, sans-
serif;

 font-weight: normal;
}
Fonts with Font
   Squirrel

  http://www.fontsquirrel.com
Font Squirrel
Font Squirrel
@font-face {

 font-family: 'YanoneKaffeesatzBold';

 
 src: url('yanonekaffeesatz-bold-webfont.eot');

 
 src: local('☺'), url('yanonekaffeesatz-bold-
webfont.woff') format('woff'), url('yanonekaffeesatz-
bold-webfont.ttf') format('truetype'),
url('yanonekaffeesatz-bold-webfont.svg#webfontUcEp3Pt5')
format('svg');

 font-weight: normal;

 font-style: normal;
}
Hosted font services
     http://www.typekit.com
      http://fontdeck.com/
rachelandrew.co.uk
Backgrounds &
Borders module

   W3C Candidate Recommendation
http://www.w3.org/TR/css3-background/
multiple
         backgrounds

Apply more than one background image to an element
backgrounds
blockquote {

 
 background: url(quote-
left.gif) top left no-repeat,

 
 url(quote-right.gif) bottom
right no-repeat;

 }
backgrounds
border-radius

 Yes! CSS rounded corners
border-radius
.box1   {

 
     background-color: #a18c83;

 
     border: 3px solid #6d4d6b;

 
     -moz-border-radius: 15px;

 
     -webkit-border-radius: 15px;
         border-radius: 15px;

   
   color: #fff;

   
   padding: 10px;

   
   margin: 0 0 20px 0;

   }


   .box2 {

   
 border: 5px solid #6d4d6b;

   
 -moz-border-radius-topleft: 50px;

   
 -webkit-border-top-left-radius: 50px;
       border-top-left-radius: 50px;

   
 padding: 10px 5px 5px 20px;

   }
border-radius
Browser
Support
Media Queries

    W3C Candidate Recommendation
http://www.w3.org/TR/css3-mediaqueries/
Media Queries
target browser characteristics, for example screen
           resolution, width and height
Media Queries
div#wrapper {

   width: 780px;

   margin-left: auto;

   margin-right: auto;
}

div#header {

   background-image: url(media-queries-browser.jpg);

   height: 349px;

   position: relative;
}

#content {

   float: left;

   width: 540px;
}

#navigation {

   float:right;

   width: 200px;
}
Media Queries
Media Queries
@media screen and (max-device-width: 480px) {

   
    div#wrapper {

   
    
   width: 400px;

   
    }


   
    div#header {

   
    
   background-image: url(media-queries-phone.jpg);

   
    
   height: 93px;

   
    
   position: relative;

   
    }

   

   
    div#header h1 {

   
    
   font-size: 140%;

   
    }

   

   
    #content {

   
    
   float: none;

   
    
   width: 100%;

   
    }


   
    #navigation {

   
    
   float:none;

   
    
   width: auto;

   
    }

   }
Media Queries
Media Queries
<link media="screen and (max-
device-width: 480px)"
href="small.css" type= "text/
css" rel="stylesheet" />
2010.dconstruct.org
2010.dconstruct.org
Thank you.

    Slides and resources: http://wp.me/PorPc-9d
Photo credit for Media Queries example: http://www.flickr.com/photos/dominicspics/4625808875/
            Font for web fonts example: http://www.yanone.de/typedesign/kaffeesatz/

More Related Content

What's hot

前端开发理论热点面对面:从怎么看,到怎么做?
前端开发理论热点面对面:从怎么看,到怎么做?前端开发理论热点面对面:从怎么看,到怎么做?
前端开发理论热点面对面:从怎么看,到怎么做?Kejun Zhang
 
Css & css3
Css & css3Css & css3
Css & css3isha
 
Curso CSS3 com Sass e Compass - Aula 01 - Introducão
Curso CSS3 com Sass e Compass - Aula 01 - IntroducãoCurso CSS3 com Sass e Compass - Aula 01 - Introducão
Curso CSS3 com Sass e Compass - Aula 01 - IntroducãoLoiane Groner
 
Html standards presentation
Html standards presentationHtml standards presentation
Html standards presentationTiago Cardoso
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockMarco Pinheiro
 

What's hot (7)

前端开发理论热点面对面:从怎么看,到怎么做?
前端开发理论热点面对面:从怎么看,到怎么做?前端开发理论热点面对面:从怎么看,到怎么做?
前端开发理论热点面对面:从怎么看,到怎么做?
 
Theme02
Theme02Theme02
Theme02
 
Tmx9
Tmx9Tmx9
Tmx9
 
Css & css3
Css & css3Css & css3
Css & css3
 
Curso CSS3 com Sass e Compass - Aula 01 - Introducão
Curso CSS3 com Sass e Compass - Aula 01 - IntroducãoCurso CSS3 com Sass e Compass - Aula 01 - Introducão
Curso CSS3 com Sass e Compass - Aula 01 - Introducão
 
Html standards presentation
Html standards presentationHtml standards presentation
Html standards presentation
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 

Viewers also liked

Presentación Multimedia - HTML5
Presentación Multimedia - HTML5Presentación Multimedia - HTML5
Presentación Multimedia - HTML5Viviana Trujillo
 
ตัวอย่าง Workshop basic html5 and css3 จากไอทีจีเนียส
ตัวอย่าง Workshop basic html5 and css3 จากไอทีจีเนียสตัวอย่าง Workshop basic html5 and css3 จากไอทีจีเนียส
ตัวอย่าง Workshop basic html5 and css3 จากไอทีจีเนียสSamit Koyom
 
Techdays 2012 - Développement Web Mobile avec Microsoft
Techdays 2012 - Développement Web Mobile avec MicrosoftTechdays 2012 - Développement Web Mobile avec Microsoft
Techdays 2012 - Développement Web Mobile avec Microsoftwyggio
 
Microsoft TechDays - CSS3 Presentation
Microsoft TechDays - CSS3 PresentationMicrosoft TechDays - CSS3 Presentation
Microsoft TechDays - CSS3 PresentationRachel Andrew
 
Structure Web Content
Structure Web ContentStructure Web Content
Structure Web ContentNicole Ryan
 
Laying Out Elements with CSS
Laying Out Elements with CSSLaying Out Elements with CSS
Laying Out Elements with CSSNicole Ryan
 
Getting Started with CSS
Getting Started with CSSGetting Started with CSS
Getting Started with CSSNicole Ryan
 
Tabela inss 2011
Tabela inss 2011Tabela inss 2011
Tabela inss 2011Joaoce2011
 
Portal Educativo Xunta
Portal Educativo XuntaPortal Educativo Xunta
Portal Educativo Xuntapcuestacefore
 
Marcas más Populares México Febrero2012
Marcas más Populares México   Febrero2012Marcas más Populares México   Febrero2012
Marcas más Populares México Febrero2012IAB México
 
Macul2011 text
Macul2011 textMacul2011 text
Macul2011 textelizkeren
 

Viewers also liked (20)

Presentación Multimedia - HTML5
Presentación Multimedia - HTML5Presentación Multimedia - HTML5
Presentación Multimedia - HTML5
 
ตัวอย่าง Workshop basic html5 and css3 จากไอทีจีเนียส
ตัวอย่าง Workshop basic html5 and css3 จากไอทีจีเนียสตัวอย่าง Workshop basic html5 and css3 จากไอทีจีเนียส
ตัวอย่าง Workshop basic html5 and css3 จากไอทีจีเนียส
 
Techdays 2012 - Développement Web Mobile avec Microsoft
Techdays 2012 - Développement Web Mobile avec MicrosoftTechdays 2012 - Développement Web Mobile avec Microsoft
Techdays 2012 - Développement Web Mobile avec Microsoft
 
Microsoft TechDays - CSS3 Presentation
Microsoft TechDays - CSS3 PresentationMicrosoft TechDays - CSS3 Presentation
Microsoft TechDays - CSS3 Presentation
 
Css floats
Css floatsCss floats
Css floats
 
Structure Web Content
Structure Web ContentStructure Web Content
Structure Web Content
 
Laying Out Elements with CSS
Laying Out Elements with CSSLaying Out Elements with CSS
Laying Out Elements with CSS
 
Getting Started with CSS
Getting Started with CSSGetting Started with CSS
Getting Started with CSS
 
Iconografia Da RepúBlica Beatriz
Iconografia Da RepúBlica   BeatrizIconografia Da RepúBlica   Beatriz
Iconografia Da RepúBlica Beatriz
 
Monitorizare mai 2013
Monitorizare mai 2013Monitorizare mai 2013
Monitorizare mai 2013
 
Pt 175 rc-web
Pt 175 rc-webPt 175 rc-web
Pt 175 rc-web
 
Details of website
Details of websiteDetails of website
Details of website
 
Kinas moderna historia
Kinas moderna historiaKinas moderna historia
Kinas moderna historia
 
Puddles
PuddlesPuddles
Puddles
 
Tabela inss 2011
Tabela inss 2011Tabela inss 2011
Tabela inss 2011
 
Ch07 5
Ch07 5Ch07 5
Ch07 5
 
Portal Educativo Xunta
Portal Educativo XuntaPortal Educativo Xunta
Portal Educativo Xunta
 
Marcas más Populares México Febrero2012
Marcas más Populares México   Febrero2012Marcas más Populares México   Febrero2012
Marcas más Populares México Febrero2012
 
Macul2011 text
Macul2011 textMacul2011 text
Macul2011 text
 
Kleeneze 2011 ewb 10
Kleeneze 2011 ewb 10Kleeneze 2011 ewb 10
Kleeneze 2011 ewb 10
 

Similar to Core CSS3

Introduction to Responsive Web Design
Introduction to Responsive Web DesignIntroduction to Responsive Web Design
Introduction to Responsive Web DesignClarissa Peterson
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeDerek Christensen
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. The University of Akron
 
Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Todd Zaki Warfel
 
Lect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptxLect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptxzainm7032
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptraghavanp4
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Sadaaki HIRAI
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1Heather Rock
 
Responsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebResponsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebEduardo Shiota Yasuda
 
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile Event
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile EventHTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile Event
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile EventRobert Nyman
 
Web Development for Mobile: GTUG Talk at Google
Web Development for Mobile: GTUG Talk at GoogleWeb Development for Mobile: GTUG Talk at Google
Web Development for Mobile: GTUG Talk at GoogleEstelle Weyl
 
Module 4 Minuteman Lexington Web Design Daniel Downs
Module 4 Minuteman Lexington Web Design Daniel DownsModule 4 Minuteman Lexington Web Design Daniel Downs
Module 4 Minuteman Lexington Web Design Daniel DownsDaniel Downs
 
Modifying your themes design - Learning CSS - Atlanta WordPress users group
Modifying your themes design - Learning CSS - Atlanta WordPress users groupModifying your themes design - Learning CSS - Atlanta WordPress users group
Modifying your themes design - Learning CSS - Atlanta WordPress users groupEvan Mullins
 
CSS3: Are you experienced?
CSS3: Are you experienced?CSS3: Are you experienced?
CSS3: Are you experienced?Denise Jacobs
 

Similar to Core CSS3 (20)

Introduction to Responsive Web Design
Introduction to Responsive Web DesignIntroduction to Responsive Web Design
Introduction to Responsive Web Design
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to life
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors.
 
Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3
 
Lect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptxLect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptx
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
 
Fundamental CSS3
Fundamental CSS3Fundamental CSS3
Fundamental CSS3
 
Responsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebResponsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da Web
 
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile Event
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile EventHTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile Event
HTML5 and CSS3: Exploring Mobile Possibilities - London Ajax Mobile Event
 
Web Development for Mobile: GTUG Talk at Google
Web Development for Mobile: GTUG Talk at GoogleWeb Development for Mobile: GTUG Talk at Google
Web Development for Mobile: GTUG Talk at Google
 
Module 4 Minuteman Lexington Web Design Daniel Downs
Module 4 Minuteman Lexington Web Design Daniel DownsModule 4 Minuteman Lexington Web Design Daniel Downs
Module 4 Minuteman Lexington Web Design Daniel Downs
 
HTML5, the new buzzword
HTML5, the new buzzwordHTML5, the new buzzword
HTML5, the new buzzword
 
Introduccion a HTML5
Introduccion a HTML5Introduccion a HTML5
Introduccion a HTML5
 
html5
html5html5
html5
 
Modifying your themes design - Learning CSS - Atlanta WordPress users group
Modifying your themes design - Learning CSS - Atlanta WordPress users groupModifying your themes design - Learning CSS - Atlanta WordPress users group
Modifying your themes design - Learning CSS - Atlanta WordPress users group
 
CSS3: Are you experienced?
CSS3: Are you experienced?CSS3: Are you experienced?
CSS3: Are you experienced?
 

More from Rachel Andrew

All Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid LayoutAll Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid LayoutRachel Andrew
 
SmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid LayoutSmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid LayoutRachel Andrew
 
Unlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid LayoutUnlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid LayoutRachel Andrew
 
The Creative New World of CSS
The Creative New World of CSSThe Creative New World of CSS
The Creative New World of CSSRachel Andrew
 
Into the Weeds of CSS Layout
Into the Weeds of CSS LayoutInto the Weeds of CSS Layout
Into the Weeds of CSS LayoutRachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17Rachel Andrew
 
View Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & FriendsView Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & FriendsRachel Andrew
 
DevFest Nantes - Start Using CSS Grid Layout today
DevFest Nantes - Start Using CSS Grid Layout todayDevFest Nantes - Start Using CSS Grid Layout today
DevFest Nantes - Start Using CSS Grid Layout todayRachel Andrew
 
Start Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSStart Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSRachel Andrew
 
404.ie: Solving Layout Problems with CSS Grid & Friends
404.ie: Solving Layout Problems with CSS Grid & Friends404.ie: Solving Layout Problems with CSS Grid & Friends
404.ie: Solving Layout Problems with CSS Grid & FriendsRachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - WEBU17Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - WEBU17Rachel Andrew
 
Laying out the future with grid & flexbox - Smashing Conf Freiburg
Laying out the future with grid & flexbox - Smashing Conf FreiburgLaying out the future with grid & flexbox - Smashing Conf Freiburg
Laying out the future with grid & flexbox - Smashing Conf FreiburgRachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - NordicJS
Solving Layout Problems with CSS Grid & Friends - NordicJSSolving Layout Problems with CSS Grid & Friends - NordicJS
Solving Layout Problems with CSS Grid & Friends - NordicJSRachel Andrew
 
Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout Rachel Andrew
 
Web Summer Camp Keynote
Web Summer Camp KeynoteWeb Summer Camp Keynote
Web Summer Camp KeynoteRachel Andrew
 
New CSS Layout Meets the Real World
New CSS Layout Meets the Real WorldNew CSS Layout Meets the Real World
New CSS Layout Meets the Real WorldRachel Andrew
 
An Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real WorldAn Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real WorldRachel Andrew
 
Perch, Patterns and Old Browsers
Perch, Patterns and Old BrowsersPerch, Patterns and Old Browsers
Perch, Patterns and Old BrowsersRachel Andrew
 
Evergreen websites for Evergreen browsers
Evergreen websites for Evergreen browsersEvergreen websites for Evergreen browsers
Evergreen websites for Evergreen browsersRachel Andrew
 

More from Rachel Andrew (20)

All Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid LayoutAll Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid Layout
 
SmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid LayoutSmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid Layout
 
Unlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid LayoutUnlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid Layout
 
The Creative New World of CSS
The Creative New World of CSSThe Creative New World of CSS
The Creative New World of CSS
 
Into the Weeds of CSS Layout
Into the Weeds of CSS LayoutInto the Weeds of CSS Layout
Into the Weeds of CSS Layout
 
Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17
 
Graduating to Grid
Graduating to GridGraduating to Grid
Graduating to Grid
 
View Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & FriendsView Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & Friends
 
DevFest Nantes - Start Using CSS Grid Layout today
DevFest Nantes - Start Using CSS Grid Layout todayDevFest Nantes - Start Using CSS Grid Layout today
DevFest Nantes - Start Using CSS Grid Layout today
 
Start Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSStart Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJS
 
404.ie: Solving Layout Problems with CSS Grid & Friends
404.ie: Solving Layout Problems with CSS Grid & Friends404.ie: Solving Layout Problems with CSS Grid & Friends
404.ie: Solving Layout Problems with CSS Grid & Friends
 
Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - WEBU17Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - WEBU17
 
Laying out the future with grid & flexbox - Smashing Conf Freiburg
Laying out the future with grid & flexbox - Smashing Conf FreiburgLaying out the future with grid & flexbox - Smashing Conf Freiburg
Laying out the future with grid & flexbox - Smashing Conf Freiburg
 
Solving Layout Problems with CSS Grid & Friends - NordicJS
Solving Layout Problems with CSS Grid & Friends - NordicJSSolving Layout Problems with CSS Grid & Friends - NordicJS
Solving Layout Problems with CSS Grid & Friends - NordicJS
 
Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout
 
Web Summer Camp Keynote
Web Summer Camp KeynoteWeb Summer Camp Keynote
Web Summer Camp Keynote
 
New CSS Layout Meets the Real World
New CSS Layout Meets the Real WorldNew CSS Layout Meets the Real World
New CSS Layout Meets the Real World
 
An Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real WorldAn Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real World
 
Perch, Patterns and Old Browsers
Perch, Patterns and Old BrowsersPerch, Patterns and Old Browsers
Perch, Patterns and Old Browsers
 
Evergreen websites for Evergreen browsers
Evergreen websites for Evergreen browsersEvergreen websites for Evergreen browsers
Evergreen websites for Evergreen browsers
 

Recently uploaded

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
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
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
 
"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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
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
 
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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
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
 
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
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
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
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 

Recently uploaded (20)

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
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
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
 
"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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
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
 
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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
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
 
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!
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
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
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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
 

Core CSS3

Editor's Notes

  1. I&amp;#x2019;m Rachel Andrew. You can find me on Twitter @rachelandrew and the links here are to my personal and business sites if you want to know who I am. The important thing is that I&amp;#x2019;m a front and back-end web developer and spend my days actually using the stuff I&amp;#x2019;m going to be talking about today on commercial projects for real clients. So I tend to take a pretty practical approach to it and feature the things I feel are useful right now.
  2. This session is Core CSS3 - so in the next 40 minutes or so we&amp;#x2019;ll have a look at CSS3 with an emphasis on things we can use right now. Don&amp;#x2019;t worry about taking notes or copying down code - I&amp;#x2019;ll give you a link at the end of the presentation where you can download slides, example code, and any links for examples. So what is CSS3?
  3. Fairly obvious - CSS3 is the next version of CSS.
  4. Earlier versions of CSS were a single monolithic spec. CSS3 is different - it is broken down into modules.
  5. Modules are at different levels of completeness and slower, more involved modules then don&amp;#x2019;t hold up other parts of the spec.
  6. Working Draft (WD) A Working Draft is a document that W3C has published for review by the community, including W3C Members, the public, and other technical organizations. Candidate Recommendation (CR) - gather implementation experience Proposed Recommendation (PR) - sent to the W3C Advisory Committee for final endorsement. W3C Recommendation (REC) -specification or set of guidelines that, after extensive consensus-building, has received the endorsement of W3C Members and the Director. W3C recommends the wide deployment of its Recommendations.
  7. Browsers have been implementing parts of the CSS3 spec for a long time. Firefox, Opera, Safari, Chrome etc. all offer support for many different parts of the spec.
  8. Vendor specific extensions are one way that browser manufacturers started to implement CSS3 at a very early stage of some modules.
  9. We&amp;#x2019;ll be looking at this in detail later but border-radius (which gives us rounded corners in pure CSS) is one place where browsers implemented support with their own extensions.
  10. The 1st line is how Mozilla implemented this in Firefox when the module was at a very early stage, the 2nd is the webkit extension for Safari and other webkit browsers (including Chrome). Safari 5 - just out - has added support for the standard border-radius. The last line here is the actual CSS3 border radius property. If using a Vendor specific extension always add the actual CSS3 declaration as well. For example when IE9 comes out it will support border-radius, if you omit it now from your CSS then IE9 won&amp;#x2019;t show the rounded corners even though it would be able to.
  11. a W3C approved way to add extensions Usually added at an early stage of module development If the module changes the browser doesn&amp;#x2019;t need to change their implementation thus breaking older code. Use carefully and keep an eye on the actual spec and correct way to do things.
  12. I&amp;#x2019;m now going to take a look at some practical examples of CSS3 - things that I&amp;#x2019;m currently using in real sites.
  13. Selectors module
  14. In CSS 1 and 2 we had selectors that let us target things such as html elements - h1, h2, paragraphs, divs and also classes and ids. Often have to add classes just for the CSS - for example a class on the last item on a list Annoying when we can access the mark-up, doesn&amp;#x2019;t help separate presentation from content &amp; structure Sometimes we can&amp;#x2019;t access the mark-up - generated by a CMS we can&amp;#x2019;t change etc. and then we end up having to lose bits of a design because we can&amp;#x2019;t do them without adding classes.
  15. CSS3 selectors will just make our lives so much easier - both for front and back-end developers.
  16. first-child actually appears in the 2.1 spec however lack of browser support in older versions of IE means it doesn&amp;#x2019;t get a lot of use. It&amp;#x2019;s a nice easy way to start looking at more advanced selectors however.
  17. We have a set of paragraphs -these are inside a div with an id of wrapper. With CSS2 we would need to put a class on the first para in order to style it differently.
  18. As this screenshot shows - the CSS we used means we can target that first paragraph and make the text larger without needing to add anything to the mark-up.
  19. Introduced in CSS3
  20. An example where last-child might be useful is when styling list navigation. The li elements have a bottom border but we don&amp;#x2019;t want to put that on the last element.
  21. As you can see this removes the border just from the last li in that list - once again we don&amp;#x2019;t need to add any additional elements to our mark-up.
  22. We have a table here and the designer has requested that we colour every other table row to aid readability. This is a common request and usually means the developer has to put a class on the odd rows.
  23. Here are our odd rows all coloured as requested, with no additional mark-up.
  24. nth-child can take arguments using a multiplier in addition to odd and even keywords. Using the multiplier 2n+1 would be the same as using the keyword odd. These multipliers get a bit complicated and I would suggest having a look at the listed Sitepoint resource to get your head around how they work as they can be a very powerful way to taregt elements in your mark-up.
  25. The selectors we have looked at are all &amp;#x201C;structural pseudo-classes&amp;#x201D; they look a bit like the other pseudo-class selectors you may be familiar with - the ones we use for the different states of a link - link, visited, hover and active. Time limits me from looking at too many selectors today but another group of selectors that are very useful are known as combinators. We have things like an adjacent sibling combinator&amp;#x2019; selecting an element that is next to another element that shares the same parent. So the p that comes straight after an h1 for example.
  26. This rule would make the first paragraph directly after an h1 larger in this example.
  27. Attribute selectors were also part of CSS2.1 however lack of browser support has meant they are not much used. However as they are also part of CSS3 and very useful in our aim of not cluttering mark-up with classes we&amp;#x2019;ll have a quick look at them. Attribute selectors let you get at an element based on it&amp;#x2019;s attribute. An obvious use for these is in forms. If you just target input you get text fields, submit buttons and checkboxes etc. This usually means we stick classes on all the input elements to distinguish them. Attribute selectors let you look at the type attribute of the input element and style appropriately.
  28. There are two other things I have used attribute selectors for in this example. The labels have been styled floated left and given a width - which I don&amp;#x2019;t want to do with the checkbox label. I also wanted to display and email icon next to the email us text.
  29. So I&amp;#x2019;m using the for attribute on the label to check for the label of that field and setting it to float none and width auto. To get the email link we use the second declaration - ^= shows we want to match things in the href that begin with mailto
  30. So before we get too excited about this - what about the thorny issue of browser support? If you know a bit about CSS3 and aren&amp;#x2019;t using it right now it is probably because of the requirement to support more browsers than just those that have support for these selectors already.
  31. as you can see things look great if we look at Firefox, Safari, Chrome and Opera ... not so stunning when it comes to Internet Explorer. Even the most recent release of IE8. A couple of selectors we looked at that we part of CSS2.1 (attribute and first-child are supported by IE7 and 8) Things look up when it comes to IE9 which promises to support a lot of CSS3 however what can we do now?
  32. The first thing to check is &amp;#x201C;does it matter&amp;#x201D; that Internet Explorer sees something a bit different. In a very few cases you might feel happy to just fall back to allowing IE to not have striped tables, larger initial paragraphs etc.
  33. For most of us though, our clients would expect the site to look pretty much the same in IE8 as in Firefox so what can we do?
  34. Particularly where selectors are concerned, you can very easily add support using JavaScript.
  35. This is an example of how you can use jQuery to add support for first-child. Add a class to your rule for p.first then select the first-child using jQuery (which supports the CSS3 selectors) and add the class. You could just add the CSS directly using jQuery but then you have to remember to update the rules in the JavaScript as well as in the CSS so I feel this is a bit neater.
  36. Here is the same technique as used for last-child
  37. and nth-child. JQuery makes this very easy but you could do the same using any library you are already using on your site.
  38. IE-CSS3.js - selectors only, needs a library included as well ecsstender - several extensions for different modules if not already using javascript these can be really useful. If using js I&amp;#x2019;d usually add a fixSelectors function into my UI js file and do them there. I&amp;#x2019;d urge caution in putting these scripts in place at the beginning of a build - rmemeber some users may have an old browser and no javascript, make sure the experience is ok for them before adding js to the mix.
  39. Color module - properties that allow authors to specify the foreground color and opacity of an element
  40. Opacity effects the entire element and it&amp;#x2019;s contents.
  41. The boxes have been given an opacity value, we are also using the hover pseudo-class on the list item to change the opacity on hover.
  42. Should be noted that opacity effects everything in the li including the text.
  43. The color module introduces RGBA
  44. I needed to get a photo of my cat in here somewhere... the caption on this photo has a semi-transparent background which is implemented using RGBA. I didn&amp;#x2019;t want to use opacity as that would have made the text opaque as well.
  45. The 0.5 is an opacity value on the background colour. 0 would be transparent 1 would be fully opaque - a solid colour.
  46. See an example of RGBA being used extensively on the design for 24ways.
  47. Neither opacity or RGBa are supported by IE up to version 8. If using RGBA you should specify a color using rgb before the rgba line in your CSS in order to provide a fully opaque version - without this no colour will be used. You can fake some of this using JavaScript depending on the effect you are going for. The good news is that IE9 will have support.
  48. Fonts module
  49. One thing that web designers have longed for is the ability to be able to specify particular fonts and know that users will be able to view the site in them. @font-face enables the importing of a font that you have uploaded to your web server - then that font can be used in your font stacks just like any standard font.
  50. In theory this should work like this. The @font-face rule points to the font file with a familiar url construct. You can then use it. In the real world however things are not so simple... we have two problems, different browsers and operating systems and the licensing of fonts. Many fonts you will find are not licensed in such a way that you can upload them to your web server, presuming you have a font that is able to be licensed. You can do the following:
  51. Upload your fonts and Font Squirrel will create a package of fonts that will work across all major browsers.
  52. You will end up with a fairly terrifying looking @font-face declaration but it will contain font files that work well cross browser.
  53. Using a hosted font from typekit
  54. Background and borders module
  55. So here is something that should make a lot of people happy. The CSS3 backgrounds module allows for applying multiple backgrounds to a single element.
  56. so on this blockquote element I can add image quote marks as a background at the top left and bottom right of the element without needing to add an extra element.
  57. ...which gives us a result like this. I&amp;#x2019;m sure you can think of lots of uses for multiple background images.
  58. So it is probably against the law to do a CSS3 presentation without mentioning rounded corners so here they are. The backgrounds and borders module includes the spec for adding rounded corners to an element.
  59. As of Firefox 3.6 FF supports multiple backgrounds as do recent versions of Safari, Opera and Chrome. Rounded corners are supported by all these browsers as well. IE9 will have support for these - until then you can effect support using JavaScript if required.
  60. I want to wrap up this introduction to the useful now bits of CSS3 with a quick look at media queries. The great thing about media queries is that the place where they are most useful - we already have good support.
  61. Media queries let you target browser characteristics such as screen resolution and provide alternate styles. If you have ever created a print stylesheet the concept of creating a whole new stylesheet or overwriting some existing styles should be familiar to you. Where this is very useful today is if you want to create a version of your site for the iPhone or other devices that support media queries. A device running an up to date Webkit, Opera or Mozilla based browser should have support.
  62. Here is the code that creates a two column layout.
  63. It looks something like this in Safari or other browsers. I have decided that for iPhone and other small device users I would like the big image at the top to be smaller to reduce scrolling and the layout to drop to one column with the main content at the top.
  64. so this is the code that detects the screen width of the device and resizes accordingly. The important bit is that which I have highlighted in yellow. So here we are in our main stylesheet or in style tags at the head of the document in my example just to keep it all in one place. This lot comes after the main screen CSS so overwrites them if the user has a device with a max-device-width of 480pixels.
  65. So we get something like this.
  66. I could also have 2 stylesheets and link the appropriate one using this link syntax. In practice I&amp;#x2019;d probably go for this approach as it seems neater to me to have the different styles in a separate stylesheet and I like the maintainability of it. If you only have a few changes to make though you could do them inline as previously demonstrated.
  67. example site using media queries in browser
  68. example site on iPhone. Even if you feel that a lot of CSS3 isn&amp;#x2019;t possible for you to use for your sites and clients right now, I&amp;#x2019;d really encourage you to have a look at media queries. With just a little bit of CSS you can have customised views of your site for small screen devices - a special iPhone version just thrown in for free as far as your clients are concerned. Definitely worth trying out.
  69. So that about wraps it up. (Check time for questions). Later on today or this evening - wifi permitting - I should get my slides, some resources, and example files online at the above URL - I&amp;#x2019;ll also post to my blog once they are up at rachelandrew.co.uk.