Your SlideShare is downloading. ×
0
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

HTML5 and CSS3 Techniques You Can Use Today

8,246

Published on

Published in: Technology, Design
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
8,246
On Slideshare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
123
Comments
0
Likes
5
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • As more browsers deliver rich support for the next generation of standards-based web development, new techniques are enabling web developers to design with unprecedented levels of control. In this session, learn practical HTML5 and CSS3 techniques that you can use in any web project today. Learn how to easily add drop shadows to HTML objects, how to quickly create rounded corners, how to use custom fonts, and even how to animate with CSS. All techniques are demonstrated with special attention to cross-browser support and tips for supporting older browsers
  • http://dev.w3.org/html5/html4-differences/Goes on to say:The same goes for XHTML1, which defines an XML serialization for HTML4, and DOM Level 2 HTML, which defines JavaScript APIs for both HTML and XHTML. HTML5 will replace these documents.
  • http://en.wikipedia.org/wiki/HTML
  • http://en.wikipedia.org/wiki/Cascading_Style_SheetsIE Mac: Shipped in March 2000First browser to 100% support CSS: IE on Mac!9 style sheet languages proposed in early 90sLanguages:1996:JavaScript Style Sheets (JSSS) – Netscape1994: Cascading HTML Style Sheets (CHSS)1994: Stream-based Style Sheet Proposal (SSP)
  • WHATWG FAQs on Living Standard: http://wiki.whatwg.org/wiki/FAQ#What_does_.22Living_Standard.22_mean.3F
  • What is the IE strategy for HTML5/CSS3?
  • On Microsoft’s strategy/approach to HTML5:http://blogs.msdn.com/b/ie/archive/2010/12/20/html5-site-ready-and-experimental.aspxhttp://blogs.msdn.com/b/interoperability/archive/2010/12/21/prototyping-early-w3c-html5-specifications.aspx
  • http://html5labs.interoperabilitybridges.com/http://www.beautyoftheweb.com
  • CSS3’s evolutionary approachMicrosoft is focusing primarily on adding product support at the Candidate Recommendation stageReview status of various CSS3 proposed specs: http://www.w3.org/Style/CSS/current-work
  • Microsoft Extensions: http://blogs.msdn.com/b/ie/archive/2008/09/08/microsoft-css-vendor-extensions.aspxVendor specific prefixes: http://reference.sitepoint.com/css/vendorspecific
  • -Show example of browser prefixes in actionhttp://www.w3.org/TR/CSS21/syndata.html#vendor-keywords
  • CSS3’s evolutionary approachMicrosoft is focusing primarily on adding product support at the Candidate Recommendation stageReview status of various CSS3 proposed specs: http://www.w3.org/Style/CSS/current-work
  • This is not a question with a single correct answer. It all depends on your audience and strategy.There are several general strategies for defining what is “usable” today.
  • Useful for adding HTML5 to both older browsers + new browsers that do not have a specific HTML5 featurehttp://remysharp.com/2010/10/08/what-is-a-polyfill/https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills
  • Strategy: Design for lowest common denominator, Enrich/Enhance as more capabilities are availableImage Source: http://www.flickr.com/photos/aaronolaf/833342657/
  • Strategy: Design for best case scenario (premium features), and gracefully remove features as resources are not availableImage Source: http://www.mbusa.com/mercedes/index
  • http://dev.w3.org/html5/html4-differences/
  • HTML5 & CSS3 in VS2010 SP1: http://madskristensen.net/post/HTML5-CSS3-in-Visual-Studio-2010-SP1.aspxHTML5 in VS2008: http://stackoverflow.com/questions/1682180/will-visual-studio-2010-support-html-5
  • http://code.google.com/p/ie7-js/Testing IE:http://spoon.net/browsers/Three choices: Hack it – Force features with JS shivsSupport it – Provide gracefully degraded experienceKill it – Provide message indicating no or limited support
  • http://www.modernizr.comhttp://www.alistapart.com/articles/taking-advantage-of-html5-and-css3-with-modernizr/Modernizr now ships with ASP.NET MVC 3
  • http://diveintohtml5.org/geolocation.htmlSpec: http://dev.w3.org/geo/api/spec-source.htmlOnly lat, long, acc are guranteed. Other values might be available, including altitude, altitudeAccuracy, heading, speedCan force maximum age for cached geolocation objectsCan handle errors and make repeat location calls using navigatior.geolocation.watchPosition(successCallback, errorCallback, {maximumAge:time})Google Maps API v3 Reference: http://code.google.com/apis/maps/documentation/javascript/basics.html(Free to use on all apps that are free to consumers – no API keys needed)
  • http://html5demos.com/storageTutorial:http://html5tutorial.net/tutorials/working-with-html5-localstorage.htmlFallback for older browsers: http://amplifyjs.com/api/store/
  • http://diveintohtml5.org/forms.htmlPolyfills for other HTML5 features:http://ericleads.com/h5validate/
  • http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=164506Google tool for testing Rich Snippets: http://www.google.com/webmasters/tools/richsnippetsGoogle will not show content from hidden div's in Rich Snippets.Currently, review sites and social networking/people profile sites are eligible. We plan to expand Rich Snippets to other types of content in the future. (Sept 2010)http://knol.google.com/k/google-rich-snippets-tips-and-tricksImprove video discovery: http://googlewebmastercentral.blogspot.com/2009/09/supporting-facebook-share-and-rdfa-for.htmlAnother very popular emerging microformat: Open Graph (by Facebook)http://developers.facebook.com/tools/linthttp://ogp.me/
  • http://upload.wikimedia.org/wikipedia/en/d/d0/Chrome_Logo.svgComparison articles:Great comparison: http://dev.opera.com/articles/view/svg-or-canvas-choosing-between-the-two/http://blogs.sitepoint.com/2010/07/06/canvas-vs-svg-how-to-choose/ (IDEA: progressive enhancement techniques — for example, IE8 and earlier versions show a table of data whereas supported browsers show an animated pie chart.)SVG Bridge for all browsers:http://raphaeljs.com/CANVAS Bridge for IE: http://code.google.com/p/explorercanvas/(Pointless canvas example: http://paulirish.com/2010/high-res-browser-icons/)SVG is DOM-based. All elements exist in DOM. Thus, you can attach event handlers. CON: Many objects can hurt perf.CANVAS is PIXEL-based. All elements rendered quickly, but not part of DOM. CON: Harder to interact.
  • http://flashcanvas.net/http://code.google.com/p/explorercanvas/
  • http://www.javascriptkit.com/dhtmltutors/customattributes.shtmlhttp://html5doctor.com/html5-custom-data-attributes/Two methods of access:- Via Attributes (http://api.jquery.com/category/attributes/)Via “dataset” (plug-in required today: http://www.orangesoda.net/jquery.dataset.html)
  • http://www.impressivewebs.com/css3-click-chart/
  • http://html5reset.org/http://meyerweb.com/eric/tools/css/reset/http://html5doctor.com/html-5-reset-stylesheet/http://html5boilerplate.com/
  • @font-face was first proposed for CSS2 and has been implemented in Internet Explorer since version 5IE relied on proprietary Embedded Open Type (.eot)Old school solutions involved things like sIFR (http://www.mikeindustries.com/blog/sifr/)Modern browsers finally support TTF and OTF + Most support new WOFF (exception is Safari)Resources:http://www.css3.info/preview/web-fonts-with-font-face/http://www.alistapart.com/articles/cssatten
  • Making fonts compatible with IE requires some work-around:http://randsco.com/index.php/2009/07/04/p680\\Discussion of WOFF:http://en.wikipedia.org/wiki/Web_Open_Font_Format
  • Fix “bleeding” in Webkit with: -webkit-background-clip: padding-box;http://tumble.sneak.co.nz/post/928998513/fixing-the-background-bleedhttp://css3pie.com/
  • Not supported in IE9
  • http://designshack.co.uk/articles/introduction-to-css3-part-6-backgroundshttp://www.css3.info/preview/background-origin-and-background-clip/
  • Relatively new CSS standard defining Gradients: http://www.w3.org/TR/css3-images/IMAGES FROM: http://www.webdesignerwall.com/tutorials/cross-browser-css-gradient/Great visual CSS gradient generator: http://www.display-inline.fr/projects/css-gradient/#startType=hex&startValue=aaeeff&endType=hex&endValue=3399ccSimple Visual gradient creator: http://gradients.glrzad.com/Good explanation:http://www.dynamicdrive.com/style/csslibrary/item/css3_linear_gradients/background: black;background: -moz-linear-gradient(top, black, white);background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(black), to(white)); /*You can also make gradient stops*/-moz-linear-gradient( top,rgb(214,24,166) 0%,rgb(255,51,200) 50%,rgb(255,77,240) 87%)
  • http://www.webdesignerwall.com/tutorials/css3-media-queries/http://www.w3.org/TR/css3-mediaqueries/http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727/
  • Great tutorial:http://designshack.co.uk/articles/css/using-less-js-to-simplify-your-css3LESS site: http://lesscss.org/
  • Not currently supported in IE9CSS3 Animation Examples:http://webdeveloperjuice.com/demos/css/css3effects.html#secondhttp://anthonycalzadilla.com/css3-ATAT/index.htmlhttp://www.optimum7.com/css3-man/animation.html
  • Great resourcefor checking mobile support: http://caniuse.com
  • Transcript

    • 1. HTML5 and CSS3 Techniques You Can Use TodayDEV334<br />Todd Anglin<br />Chief Evangelist<br />Telerik<br />
    • 2. Introductions<br />Todd Anglin<br />Chief Evangelist, Telerik<br />Microsoft MVP<br />ASP Insider<br />President NHDNUG &amp; O’Reilly Author<br />TelerikWatch.com<br />@toddanglin<br />
    • 3. Development Tools<br />Agile Planning<br />Testing<br />
    • 4. Session Road Map<br />Goal: Leave with at least 1 <br />HTML5/CSS3 technique <br />you can use today<br />
    • 5. “<br />While it continues to serve as a rough guide to many of the core features of HTML, it does not provide enough information to build implementations that interoperate with each other and, more importantly, with a critical mass of deployed content.”<br />-W3C on HTML4<br />
    • 6. HTML4 = Rough Guide<br />Unpredictable Browser Support<br />
    • 7. HTML &amp; CSS History<br />HTML5<br />Addressing modern web applications &amp; pains of the past<br />
    • 8. HTML &amp; CSS History<br />CSS: Plagued by implementation bugs &amp; inconsistencies<br />CSS3<br />Improve consistency &amp; power of styling language<br />
    • 9. How is the web evolving?<br />
    • 10. {<br />}<br />&lt;HTML&gt;<br />CSS:3;<br />EMCAScript();<br />“HTML5”<br />
    • 11. “Living Standard”<br /> Offline <br />Canvas Video<br /> Audio<br />WebSocketsFileAPI<br />WebGL<br /> HTML5 Forms<br />Geolocation<br />WHATWG | W3C | IETF<br />
    • 12. Stable<br />Canvas | Local Storage |Microdata| Document Editing |Geolocation| Semantic Tags | Video/Audio | Selectors<br />In Progress<br />WebGL | WebSockets | File API | Drag-Drop API | IndexDB | Offline API | Web Workers | HTML5 Forms<br />
    • 13.
    • 14. IE9 offers support for the most relevant, real-world web patterns that developers are using today as well as the HTML5 patterns we expect to become more mainstream.”<br />“<br />-Dean Hachamovitch<br />Corporate VP, IE<br />
    • 15. html5labs.interoperabilitybridges.com<br />+<br />Platform Previews<br />ie.microsoft.com/testdrive<br />
    • 16. CSS 2.1<br />Selectors<br />CSS Color<br />CSS 2<br />Backgrounds &amp;<br />Borders<br />Media Queries<br />Multi-column<br />25+ Drafts<br />Transitions<br />Transformations<br />Animations<br />Gradients<br />CSS3 Text<br />
    • 17. -moz-border-radius: 5px 5px5px5px; <br />-webkit-border-radius: 5px;<br />border-radius: 5px;<br />-moz-box-shadow: 2px 2px2px #333;<br />-webkit-box-shadow: 2px 2px2px #333;<br />box-shadow: 2px 2px2px #333;<br />-webkit-background-size: 137px 50px;<br />-o-background-size: 137px 50px;<br />background-size: 137px 50px;<br />
    • 18. Browser Prefixes<br />-webkit<br />-moz<br />-o<br />-ms<br />“standard” way browsers implement experimental features<br />
    • 19. Browser Prefixes<br />15<br />
    • 20. WD<br />LC<br />CR<br />PR<br />RE<br />
    • 21. What is usable today?<br />
    • 22. Adoption Strategies<br />Lowest Common Dominator<br />Only use features natively available in all target browsers<br />
    • 23. Adoption Strategies<br />PolyfillEnriched<br />Only use features either natively available OR available via JavaScript polyfill<br />X X<br />
    • 24. polyfill<br />(n) poly • fill: JavaScript that implants HTML5 functionality in a browser that does not offer native support<br />
    • 25. Adoption Strategies<br />Alternate Experiences<br />Only use features available in target browsers AND design alternate experience for other browsers<br />X X<br />X X X<br />X X<br />
    • 26. progressiveenhancementgracefuldegradation<br />
    • 27. [Source: Aaron Olaf, Flickr]<br />
    • 28. [Source: Mercedes USA, http://mbusa.com/]<br />
    • 29. Adoption Strategies<br />Vertical Target<br />Create experiences targeted at specific browsers (or classes of browsers)<br />X X<br />X X X<br />X X<br />
    • 30. Real World Browser Support<br />Better, but not perfect<br />Know your users. Know your browsers.<br />
    • 31. HTML5 Techniques<br />You can use today<br />
    • 32. W3C on HTML5<br />Defines a single language called HTML5 which can be written in HTML syntax and in XML syntax.<br />Defines detailed processing models to foster interoperable implementations.<br />Improves markup for documents.<br />Introduces markup and APIs for emerging idioms, such as Web applications.<br />
    • 33. Enriching VS Experience<br />Add IntelliSense &amp; Schema Validation to <br />Visual Studio 2008/2010 (pre SP1) editor<br />http://bit.ly/vsHTML5<br />http://bit.ly/vsSVG<br />
    • 34. Older Browsers<br />
    • 35. Modernizr<br />Shiv’r + Inspector<br />Simple way to check feature support<br />Conditional JS and CSS<br />.multiplebgs div p {<br /> /* properties for browsers that<br /> support multiple backgrounds */<br />}<br />.no-multiplebgs div p {<br /> /* optional fallback properties<br /> for browsers that don&apos;t */<br />}<br />if (Modernizr.canvas) {<br /> //Canvas supported<br />}<br />if (Modernizer.cssColumns){<br /> //Columns supported<br />}<br />//Etc...<br />*Don’t use with IE HTML5shiv. One or the other.<br />
    • 36. DEMO<br />Polyfilling &amp; Older Browsers<br />with Modernizr<br />
    • 37. Semantic Tags<br />Tags with meaning<br />&lt;body&gt;<br /> &lt;div id=“header”&gt;<br /> &lt;/div&gt;<br /> &lt;div id=“content”&gt;<br /> &lt;div id=“nav”&gt;&lt;/div&gt;<br /> &lt;/div&gt;<br /> &lt;div id=“footer”&gt;<br /> &lt;/div&gt;<br />&lt;/body&gt;<br />&lt;body&gt;<br /> &lt;header&gt;<br /> &lt;/header&gt;<br /> &lt;section&gt;<br /> &lt;nav&gt;&lt;/nav&gt;<br /> &lt;/section&gt;<br /> &lt;footer&gt;&lt;/footer&gt;<br />&lt;/body&gt;<br />VS.<br />*Need polyfill to trigger styling in old IE<br />Safe to use today!<br />
    • 38. Video &amp; Audio<br />Semantic rich media<br />Reach more people on more devices<br />Container<br />MP4<br />H.264<br />Codec<br />Safe to use today!<br />
    • 39. Geolocation<br />Usable on modern browsers + mobile<br />Requires plug-in for older browsers<br />navigator.geolocation.getCurrentPosition(callback);<br />function callback(position){<br />varlat = position.coords.latitude;<br />varlng = position.coords.longitude;<br />varacc = position.coords.accuracy;<br />}<br />Safe to use today!<br />
    • 40. Local Storage<br />Usable in modern browsers<br />sessionStorage.setItem(&apos;value&apos;, this.value);<br />localStorage.setItem(&apos;value&apos;, this.value);<br />sessionStorage.getItem(‘value’);<br />sessionStorage.clear();<br />localStorage.clear();<br />sessionStorage = per window<br />localStorage = per browser<br />5 MB limit<br />
    • 41. HTML5 Forms<br />Improved usability<br />Uneven support across browsers<br />&lt;form name=&quot;f&quot;&gt;<br /> &lt;input id=&quot;q&quot; autofocus&gt;<br /> &lt;!--Technique to support older browsers--&gt;<br /> &lt;script&gt;<br /> if (!(&quot;autofocus&quot; in document.createElement(&quot;input&quot;))) {<br />document.getElementById(&quot;q&quot;).focus();<br /> }<br /> &lt;/script&gt;<br /> &lt;input type=&quot;submit&quot; value=&quot;Go&quot;&gt;<br />&lt;/form&gt;<br />Safe to use today!<br />
    • 42. Rich Snippets (*microdata)<br />Content with meaning<br />Machines understand more of your content<br />&lt;div itemscopeitemtype=&quot;http://data-vocabulary.org/Event&quot;&gt;<br /> &lt;time itemprop=&quot;startDate&quot; <br />datetime=&quot;2015-10-15T19:00-08:00&quot;&gt;<br /> Oct 15, 7:00PM<br /> &lt;/time&gt;—<br /> &lt;time itemprop=&quot;endDate&quot;<br />datetime=&quot;2015-10-15T19:00-08:00&quot;&gt;<br /> Oct 15, 9:00PM<br /> &lt;/time&gt;<br /> &lt;span itemprop=&quot;geo&quot; itemscope<br />itemtype=&quot;http://data-vocabulary.org/​Geo&quot;&gt;<br />&lt;meta itemprop=&quot;latitude&quot; content=&quot;37.774929&quot; /&gt;<br />&lt;meta itemprop=&quot;longitude&quot; content=&quot;-122.419416&quot; /&gt; <br /> &lt;/span&gt;<br />...<br />&lt;/div&gt;<br />Safe to use today!<br />
    • 43. SVG &amp; Canvas<br />Safe to use today!<br />
    • 44. Canvas for IE6/7/8<br />Many polyfills for older browsers<br />JavaScript or Flash based<br />Better Perf<br />
    • 45. Custom Attributes<br />data-*<br />Valid approach to storing data in HTML<br />&lt;!--Store values in data-* attributes--&gt;<br />&lt;div id=&quot;mydiv&quot; data-key=&quot;26&quot; data-name=&quot;My product name&quot;&gt;<br />This product is an extremely popular choice.<br />&lt;/div&gt;<br />&lt;!--Access values with JavaScript--&gt;<br />varmydiv=document.getElementById(&apos;mydiv&apos;)<br />//Using DOM&apos;s getAttribute() property<br />varkey = mydiv.getAttribute(&quot;data-key&quot;) //returns &quot;26&quot; <br />//OR Using JavaScript&apos;s dataset property**var key = mydiv.dataset.key //returns &quot;26&quot;<br />Safe to use today!<br />
    • 46. CSS3 Techniques<br />You can use today<br />
    • 47. Leveling the Playing Field<br />CSS Reset<br />Browsers ship with built-in styles – zero them out!<br />Enable newer features in older browsers<br />http://html5reset.org<br />http://html5boilerplate.com<br />
    • 48. CSS3 Selectors<br />Powerful new selector options<br />//Alternating Items<br />li:nth-child(odd) { color: blue; }<br />li:nth-child(even) { color: green; }<br />li:nth-child(3n) { color: red; } //Every 3rd item<br />//First/Last Items<br />li:first-of-type { color: blue; }<br />li:not(:first-of-type):not(:last-of-type) { color: orange; } //All *but* first/last<br />//Enabled/Disabled<br />input:enabled { border: 2px solid green; }<br />input:disabled{ background-color: #BBB; }<br />*Use jQuery to support legacy browsers<br />
    • 49. CSS3 Color<br />HSL and RGB<br />Support for new color models + alpha channels<br />//HSL<br />background:hsl(320,100%,25%);<br />//HSLa<br />background:hsla(165, 100%, 50%, 1.0);<br />//RGB<br />background:rgb(155,100,100);<br />//RGBa<br />background:rgba(153, 134, 117, 0.2);<br />
    • 50. Custom Fonts<br />Biggest Problem?<br />Licensing!<br />@font-face { <br /> font-family: Delicious; <br />src: url(&apos;Delicious-Roman.otf&apos;) format(“opentype”); <br />} <br />//Usage<br />h3 { font-family: Delicious, sans-serif; }<br />
    • 51. Web Font Providers<br />Solve the licensing problem<br />Host the WOFF/TTF/OTF font files <br />Provide easy-to-use code<br />http://www.fontsquirrel.com/<br />http://webfonts.fonts.com<br />http://typekit.com/libraries<br />http://code.google.com/webfonts<br />
    • 52. Borders &amp; Backgrounds<br />Rounded corners, drop shadows, multi-backgrounds<br />Expect GD for older browsers<br />//Rounded Corners (Size)<br />border-radius: 5px;<br />//Drop shadow (hShift vShift Size Color)<br />box-shadow: 2px 2px 5px #333; <br />//Background control<br />background: url(top.gif) top left no-repeat,url(bottom.gif) bottom left no-repeat;<br />background-size: 150px 50px;<br />*Use CSS3 PIE to support legacy IE browsers<br />
    • 53. Drop Shadows<br />Exactly like it sounds<br />box-shadow: &lt;hShift&gt; &lt;vShift&gt; &lt;size&gt; &lt;color&gt;;<br />-moz-box-shadow: 2px 2px2px #333;<br />-webkit-box-shadow: 2px 2px2px #333;<br />box-shadow: 2px 2px2px #333;<br />Safe to use today!<br />
    • 54. Text Shadows<br />Uniform across supported browsers!<br />text-shadow: &lt;h offest&gt; &lt;v offset&gt; &lt;blur size&gt; &lt;color&gt;;<br />text-shadow: 2px 2px2px #333;<br />//You can apply multiple shadows<br />text-shadow: 2px 2px2px #333, 2px 2px 3px #CCC;<br />Safe to use today!<br />
    • 55. Backgrounds<br />More options, more power<br />multiple backgrounds<br />resize backgrounds<br />background clipping<br />/*Background size*/<br />-webkit-background-size: 137px 50px;<br />-o-background-size: 137px 50px;<br />background-size: 137px 50px;<br />/*Multiple Backgrounds*/<br />background: url(top.gif) top left no-repeat,<br />url(bottom.gif) bottom left no-repeat,<br />url(middle.gif) left repeat-y;<br />/*Background origin*/<br />background-origin: border;<br />/*Other options: padding or content*/<br />Safe to use today!<br />
    • 56. Gradients<br />Emerging CSS standard<br />But useful and desirable<br />Can be “shived” to support all browsers<br />
    • 57. Media Queries<br />Target styles to specific devices…<br />And features!<br />/*These two rules do the same thing*/<br />@media all and (min-width:500px) { … } <br />@media (min-width:500px) { … }<br />/*Multiple conditions*/<br />@media screen and (min-width: 600px) and (max-width: 900px) {<br /> .class {<br /> background: #333;<br /> }<br />}<br />
    • 58. LESS for CSS<br />Use LESS to write less CSS<br />Variables, operations, mix-ins, nested rules<br />&lt;link rel=&quot;stylesheet/less&quot; href=&quot;style.less&quot; type=&quot;text/css&quot; /&gt;<br />&lt;script src=&quot;http://lesscss.googlecode.com/files/less-1.0.21.min.js&quot;&gt;&lt;/script&gt;<br />/*Variables*/<br />@primaryColor: #383939;<br />background-color: @primaryColor;<br />/*Mix-ins!!*/<br />.roundedCorners (@radius: 12px) {<br /> -moz-border-radius: @radius;<br /> -webkit-border-radius: @radius;<br /> border-radius: @radius;<br />}<br />#page { background-color: @primaryColor; .roundedCorners; }<br />Safe to use today!<br />
    • 59. Animating with CSS<br />Animate by setting CSS properties<br />Works when JS is disabled<br />#id_of_element { <br />-webkit-transition: all 1s ease-in-out; <br />-moz-transition: all 1s ease-in-out; <br />-o-transition: all 1s ease-in-out; <br />transition: all 1s ease-in-out; <br />}<br />Safe to use today!<br />
    • 60. Tomorrow Land (aka Mobile)<br />
    • 61. which HTML5/CSS3 technique will you try?<br />
    • 62. anglin@telerik.com<br />@toddanglin + @htmlui<br />

    ×