HTML5 & CSS3 Graceful Degradation and Progressive Enhancement (Or: Say “Good Bye!” to Flash and Photoshop)
Wednesday, August 26, 2009
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
Problems with CSS • • •
Very powerful, yet still limited Few ways to select elements As with HTML: No Structure == Mess!
Wednesday, August 26, 2009
So What’s New?
Wednesday, August 26, 2009
HTML5 : Semantic Tags • • • • • •
SECTION
• • •
HGROUP
Wednesday, August 26, 2009
HEADER NAV ARTICLE FIGURE FOOTER
MENU ASIDE
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.
Nice, tidy markup HTML 4
Wednesday, August 26, 2009
HTML 5
Nice, tidy markup HTML 4
Wednesday, August 26, 2009
HTML 5
Nice, tidy markup HTML 4
HTML 5
<style> article, aside, dialog, figure, footer, header, hgroup, menu, nav, section { display: block; }
Wednesday, August 26, 2009
& •
Full play controls without Flash
• •
JS Events and JS API
Wednesday, August 26, 2009
CSS3 Hooks
Other Really Cool Stuff • • • • • Wednesday, August 26, 2009
XDMSG - Cross Domain Messages Datagrid* (new table) contentEditable with UndoManager Major update to CANVAS * “Required” s
Other Really Cool Stuff • • • • • Wednesday, August 26, 2009
Drag and Drop! Offline Storage! Formally removes center, font, strike, u (and is next) Removes formatting attributes (align, nowrap, cellpadding, border) in leu of CSS * Evolving!!!
Speaking of CSS • • •
Border: color, image, radius
•
HSL, HSLA, RGBA colors (no longer limited to hex)
• • • •
Wednesday, August 26, 2009
Box Shadow multiple backgrounds, with sizing and clipping
Text shadow, overflow, and word-wrap Box Model (box-sizing) Powerful Selectors Web Fonts, Multi-column
border-radius <style> div.round{ -moz-border-radius:1em; -webkit-border-radius: 1em; border-radius:1em; } // -moz for FireFox // -webkit for safari // border-radius for IE 8 (soon)
Wednesday, August 26, 2009
text-shadow Finally 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
New Selectors /^Patterns$/
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"
Wednesday, August 26, 2009
New Selectors By Position
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:
http://www.smashingmagazine.com/2009/08/17/taming-advanced-css-selectors/
Wednesday, August 26, 2009
nth-child(n) :nth-child(N) matches elements that are proceded by N-1 siblings in the document tree.
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.
Wednesday, August 26, 2009
Position Selectors Useful For ul li:nth-child(odd) {color: yellow;}
• •
Zebra Striping Tables
•
Styling nested menus
Wednesday, August 26, 2009
Removing borders from the bottom row of floated s
Wait a Damn Minute! What about IE?!
Wednesday, August 26, 2009
IE 6 & 7 FAIL!!! • • •
No Shadows
•
Multi backgrounds... nope..
Wednesday, August 26, 2009
Square corners Many new selectors will fail
Fixing IE 6, 7, & 8
Wednesday, August 26, 2009
•
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/
FF2 re-render bug
http://html5doctor.com/how-to-get-html5-working-in-ieand-firefox-2/
CSS3 News and Updates
http://www.css3.info
CSS3 Selectors
http://www.w3.org/TR/css3-selectors/
IE7.js
http://code.google.com/p/ie7-js/
MWD Blog
http://www.masterwebdesign.net/blog
Wednesday, August 26, 2009