CSS3 offers many new features that allow for effects previously requiring image editing or JavaScript programs. These include drop shadows, gradients, rounded corners, transparency, and animations. CSS3 selectors also allow targeting elements more precisely with less markup. Features like multiple backgrounds and flexible box layout reduce the need for divs. Browser support is improving, though graceful degradation is still needed. Tools like Selectivizr, CSS3 Pie and Modernizr help provide CSS3 support in older browsers.
Tata AIG General Insurance Company - Insurer Innovation Award 2024
CSS3: stay tuned for style
1. CSS3: stay tuned
for style
Chris Mills, Opera Software
Slides available on http://slideshare.net/chrisdavidmills
2. Who the hell am I?
‣ Opera open standards evangelist and tech writer
‣ Telling the world about open standards & Opera
‣ Improving web education
‣ Drinking beer & saving the world before morning
‣ Drumming in a heavy metal band
5. Today I'll cover
‣ Where CSS3 came from
‣ What it brings to the table
‣ Why it is worth knowing about
‣ When (and how) you can start using it
6. Where did it evolve from?
http://www.flickr.com/photos/dyanna/3202542828/
7. Brief CSS history
‣ CSS invented by Håkon Wium Lie and Bert Bos
around 1994/5
‣ CSS1 rec published in 1996
‣ CSS2 rec published 1998, including things like
absolute, relative, and fixed positioning, z-index,
media types
8. Brief CSS history
‣ CSS 2.1 work started soon after, to remove
errors and inconsistencies, but this is still not
completely finished
‣ Kept pinging back and forth between working
draft and candidate rec. Currently sat at last call
working draft, as of Dec 2010
9. Brief CSS history
‣ CSS3 also started soon after CSS2, to add new
features
‣ Earliest CSS3 drafts published in June 1999
‣ As of March 2011, there are over 40 CSS3
module drafts published
‣ Some a lot more stable than others
10. W3C breaking down?
‣ You might think so...
‣ ...especially considering the XHTML2/HTML5
debacle as well
‣ Browsers and developers are largely rushing
ahead
‣ But at least things are getting standardized
11. Vendor prefixes help...
Like sandboxes for browsers to experiment!
http://www.flickr.com/photos/horiavarlan/4290846294/
21. ...should we care?
http://www.flickr.com/photos/philliecasablanca/2816530573/
22. Simple...makes common
tasks easier and simpler
‣ Less time spent in Photoshop
‣ Less time spent with JavaScript
‣ Less presentational markup
‣ Less time spent dicking about with Flash
‣ More time spent in the pub
23. Less Photoshop
Doing this programmatically is so much more
flexible!
Classic examples:
‣ Drop shadows
‣ Gradients
‣ Rounded corners
‣ Transparency
28. Less JavaScript
Designers don't like coding
And not relying on JS can mean smaller
downloads, and better compatibility
Obvious behavioural stuff:
‣ Animation
‣ Style/layout switchers
‣ Showing/hiding
29. Animation
‣ CSS keyframe animations allow you to create
animations that run independently
‣ Transitions allow animation that is dependant
on state changes
30. Controlling layouts
‣ Media queries allow you to apply CSS
depending on browser/device attributes such
as resolution, screen width and height, and
more
‣ Multi-column layout allows you to easily put
your content into columns
31. Showing/hiding
‣ :target pseudo-class: apply CSS depending on
whether the element selected is the target of a
fragment identifier
‣ So when links are clicked you could make
panels, etc. appear.
32. Less presentational markup
‣ CSS3 includes a wide variety of new selectors
to allow you to select what you want more
easily, with less classes/ids
‣ Features like multiple background images and
rounded corners allow you to get rid of some of
those nested divisions!
37. Yes, there's browser
support to consider
‣ But most browsers support most of this stuff
now, even IE9!
‣ Most of it degrades gracefully
‣ And you can work around problems
‣ Depends on what your client needs
‣ By “identical”, how similar do you mean??
38. Try to argue the case...
...”identical in every browser” is outdated
‣ Especially with mobile phones, iPad, tablets...
‣ And IE6 is a decade old now
‣ Surely providing an acceptable experience in
each browser is, well, acceptable?
‣ Then you can spend more less time on hacking