22
HTML5 & CSS3 Graceful Degradation and Progressive Enhancement (Or: Say “Good Bye!” to Flash and Photoshop) Wednesday, August 26, 2009

HTML5 Presentation

Embed Size (px)

DESCRIPTION

HTML5 and CSS3 are two emerging standards which are rapidly gaining support from modern browsers. Learn how you can integrate HTML5 and CSS3 into your designs today and with a few simple tricks, whip IE into shape.

Citation preview

Page 1: HTML5 Presentation

HTML5 & CSS3Graceful Degradation and Progressive Enhancement

(Or: Say “Good Bye!” to Flash and Photoshop)

Wednesday, August 26, 2009

Page 2: HTML5 Presentation

Problems with HTML4

• No guidelines left uncertainty.

• Loose structure leads to “Divitus”

• Also, Class Hell / ID Hell

• Not flexible for web applications

• Tables for Layouts (evil but still reliable)

Wednesday, August 26, 2009

Page 3: HTML5 Presentation

Problems with CSS

• Very powerful, yet still limited

• Few ways to select elements

• As with HTML: No Structure == Mess!

Wednesday, August 26, 2009

Page 4: HTML5 Presentation

So What’s New?

Wednesday, August 26, 2009

Page 5: HTML5 Presentation

• SECTION

• HEADER

• NAV

• ARTICLE

• FIGURE

• FOOTER

• HGROUP

• MENU

• ASIDE

HTML5 : Semantic Tags

HTML 5 provides tags which aim to use the DOM to define the functionality and structure of the site.

Through this, markup is dramatically cleaned up and clarity is provided... Mostly.

Wednesday, August 26, 2009

Page 6: HTML5 Presentation

HTML 4 HTML 5

Nice, tidy markup

Wednesday, August 26, 2009

Page 7: HTML5 Presentation

HTML 4 HTML 5

Nice, tidy markup

Wednesday, August 26, 2009

Page 8: HTML5 Presentation

Nice, tidy markup

<!DOCTYPE html>

<style>  article, aside, dialog, figure, footer, header,  hgroup, menu, nav, section { display: block; }</style>

HTML 4 HTML 5

Wednesday, August 26, 2009

Page 9: HTML5 Presentation

<video> & <audio>

• Full play controls without Flash

• JS Events and JS API

• CSS3 Hooks

Wednesday, August 26, 2009

Page 10: HTML5 Presentation

• XDMSG - Cross Domain Messages

• Datagrid* (new table)

• contentEditable with UndoManager

• Major update to CANVAS *

• “Required” <input>s

Other Really Cool Stuff

Wednesday, August 26, 2009

Page 11: HTML5 Presentation

• Drag and Drop!

• Offline Storage!

• Formally removes center, font, strike, u (and <b> is next)

• Removes formatting attributes (align, nowrap, cellpadding, border) in leu of CSS

• * Evolving!!!

Other Really Cool Stuff

Wednesday, August 26, 2009

Page 12: HTML5 Presentation

Speaking of CSS• Border: color, image, radius

• Box Shadow

• multiple backgrounds, with sizing and clipping

• HSL, HSLA, RGBA colors (no longer limited to hex)

• Text shadow, overflow, and word-wrap

• Box Model (box-sizing)

• Powerful Selectors

• Web Fonts, Multi-column

Wednesday, August 26, 2009

Page 13: HTML5 Presentation

border-radius<style>

div.round{-moz-border-radius:1em;-webkit-border-radius: 1em;border-radius:1em;

}</style>

// -moz for FireFox// -webkit for safari// border-radius for IE 8 (soon)

Wednesday, August 26, 2009

Page 14: HTML5 Presentation

text-shadowFinally replacing the need for Photoshop for simple drop shadow effects.

text-shadow: 2px 2px 2px #000;text-shadow: right, bottom, blur, color;

Also here, is the box-shadow property.

box-shadow: 10px 10px 5px #888;box-shadow: right, bottom, blur, color;

Wednesday, August 26, 2009

Page 15: HTML5 Presentation

New Selectors

E[foo=‘bar’] an E element whose "foo" attribute value is exactly equal to "bar"

E[foo~=‘bar’] an E element whose "foo" attribute value is a list of whitespace-separated values, one of which is exactly equal to "bar"

E[foo^=‘bar’] an E element whose "foo" attribute value begins exactly with the string "bar"

E[foo$=‘bar’] an E element whose "foo" attribute value ends exactly with the string "bar"

E[foo*=‘bar’] an E element whose "foo" attribute value contains the substring "bar"

E[hfool=’en’] an E element whose "foo" attribute has a hyphen-separated list of values beginning (from the left) with "en"

/^Patterns$/

Wednesday, August 26, 2009

Page 16: HTML5 Presentation

New Selectors

E:nth-child(n) The :nth-child() pseudo-class allows you to target one or more specific children of a parent element. Can also be specified as “even” or “odd”

E:nth-last-child(n) The :nth-last-child pseudo-class works basically as the :nth-child pseudo-class, but it starts counting the elements from the last one.

E:nth-of-type(n) The :nth-of-type pseudo-class works just like the :nth-child, with the difference that it only counts children that match the element in the selector.

E:nth-last-of-type(n)You guessed it! The :nth-last-of-type pseudo-class can be used exactly like the aforementioned :nth-last-child, but this time, it will only target the elements that match our selector:

By Position

http://www.smashingmagazine.com/2009/08/17/taming-advanced-css-selectors/

Wednesday, August 26, 2009

Page 17: HTML5 Presentation

nth-child(n)

tr:nth-child(2n+1) {...}tr:nth-child(odd) {...}

Match Odd number rows

tr:nth-child(2n-1) {...}tr:nth-child(even) {...}

Match Even number rows

tr:nth-child(-n+3) {...} Selects the first 3 rows of any table.

:nth-child(N) matches elements that are proceded by N-1 siblings in the document tree.

Wednesday, August 26, 2009

Page 18: HTML5 Presentation

Useful For

• Zebra Striping Tables

• Removing borders from the bottom row of floated <LI>s

• Styling nested menus

Position Selectors

ul li:nth-child(odd) {color: yellow;}

Wednesday, August 26, 2009

Page 19: HTML5 Presentation

Wait a Damn Minute!What about IE?!

Wednesday, August 26, 2009

Page 20: HTML5 Presentation

IE 6 & 7 FAIL!!!

• No Shadows

• Square corners

• Many new selectors will fail

• Multi backgrounds... nope..

Wednesday, August 26, 2009

Page 21: HTML5 Presentation

• CurvyCorners.net for rounded corners

• filter:DropShadow for drop shadows

• IE8.js to add many selectors & fix PNGs. http://code.google.com/p/ie7-js/

Fixing IE 6, 7, & 8

Wednesday, August 26, 2009