Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to HTML5


Published on

Published in: Technology, Design

Introduction to HTML5

  1. Introduction toHTML5
  2. Who Are You?
  3. What is“HTML5”?
  4. “HTML5” is anmarketing termthat companies use to mean “cool shit that works on an
  5. “HTML5”• HTML5• CSS 3• JavaScript• CSS 2• JavaScript Frameworks• Canvas (Actually part of HTML5)• Video tag (Actually part of HTML5)• Anything the speaker wants it to mean
  6. What is HTML5?
  7. We’ll come back to that in a second.
  8. Review
  9. What is HTML?
  10. HTML is alanguage that provides structure to content
  11. Start with ContentwhichElement?Trying to answer that ageold question:Should that be a div, aspan, or something else?HomeContributeAboutOne of the main challengeswe see in building semanticcontent is picking what tagto use when.
  12. Add Structure<h1>whichElement?</h1><h2>Trying to answer that age oldquestion:</h2><h2>Should that be a div, a span, orsomething else?</h2><ul><li>Home</li><li>Contribute</li><li>About</li></ul><p>One of the main challenges we seein building semantic content ispicking what tag to use when. Thissite seeks to help with that. Now,before we get all judgy and preachylet me get a few tenants outthere:</p>
  13. What is CSS?
  14. CSS is a language that providesstyle to content
  15. Add Style<h1>whichElement?</h1><style type="text/css"><h2>Trying to answer that age old h1{question:</h2><h2>Should that red;a div, a span, or color: besomething else?</h2> } h2{<ul> color: blue;<li>Home</li> font-style: italic;<li>Contribute</li> }<li>About</li></ul> p{<p>One ofcolor:main challenges we see the white;in building semantic content is background-color: black;picking what tag to use when. Thissite }seeks to help with that. Now,before we get all judgy and preachylet me get a few tenants out</style>there:</p>
  16. HTML/CSS results inseparation ofcontent from display
  17. Why?
  18. Why separate content anddisplay?• Helps SEO• Makes work more portable or changeable• Allows for multiple ways of display
  19. Change Style<style type="text/css"><style type="text/css"> h1{ h1{ color: red; font-size: 16px; color: red; } } h2{ h2{ color: blue; font-size: 26px; } color: blue; ul{ font-style: italic; } list-style: none; clear: both; display: block; p{ width: 100%; height: 30px; color: 0; padding: white; background-color: black; } } li{ float: left; padding-right: 20px;</style> }</style>
  20. What isJavaScript?
  21. JavaScript is alanguage that provides behavior to content
  22. Behavior<html><head><script type="text/javascript"> function createAlertMessage(){ alert("Stop what youre doing!"); }</script></head><body><button onclick="createAlertMessage()">Alert!</button></body></html>
  23. ContentStructure StyleBehavior
  24. Content - Database Structure - HTML Style - CSS Behavior - JavaScript
  25. Content - HTMLStructure - HTML Style - CSS Behavior - JavaScript
  26. What is HTML5?
  27. The 5 thand most recent publicspecification for HTML from the public groups that….
  28. The 5 thand most recent publicspecification for HTML from the public groups that….
  29. The most recentspecification for HTML
  30. The most recent* specification** for HTML*** * It’s not technically the most recent ** It’s actually a standard*** While we’re at it, there is no HTML5 only HTMLThis is why pragmatic people hate standards bodies sometimes
  31. New in HTML5• New semantic elements – article, section, aside, header, footer, etc• New multimedia elements – audio, video, canvas• New API’s for manipulation in JavaScript – Offline data, drag and drop, web storage
  32. What is CSS3?
  33. A series ofrecommendation s modules to the standards committees…
  34. Can’t we just say “The latestofficial version of CSS?”
  35. It’s not official.
  36. It’s not the latest.
  37. It’s not aversion.
  38. Let’s just say “HMTL5” foreverything? Ok?
  39. What can you do with “HTML5”?
  41. Semantic HTML means your markup describesit’s content without presenting it
  42. What do we mean by SemanticHTML• HTML where proper elements are used – <p> denotes paragraph – <ul> denotes an list of items, where the order is not important – <address> contains address information – <div> and <span> are used to describe information• HTML where extraneous elements are not misused – No <p> for line breaking – No <blockquote> for indentation – No <h1> for big text• HTML without presentation information – No <font>, <b>, <i> tags – No inline styles
  43. Semantic HTML is a moving target• Not Boolean• Not always objective• A continuum
  44. Semantic HTMLRELATIVELY UNSEMANTIC RELATIVELY SEMANTIC<body background="css/bg.png"><font face="Calibri”><center> <body><table width="800" bgcolor="#FFFFFF" border="10"bordercolor="#FFFFFF"><tr><td> <div id="header"><table width="100%" bgcolor="#f0f0f0" border="0“><tr> <h1>The Awesome Blog of<td><h1> Awesome</h1><font face="Palatino Linotype">The Awesome Blog ofAwesome</font> <p class="tagline"></h1></td> Awesome is a State of</tr><tr> Mind<td align="right"><p><i>Awesome is a State ofMind</i></p></td> </p></tr></table> </div>
  45. HTML5? What does this have to do with HTML5?
  46. HTML5 adds moresemantics<body> <header> <h1>The Awesome Blog of Awesome</h1> <p>Awesome is a State of Mind</p> </header> <nav> <ul> <li><a href="">Home</a></li> <li><a href="">Blog</a></li> <li><a href="">About</a></li> <li><a href="">Contact</a></li> </ul> </nav>
  47. Outlines• Outlines seem really important to the people who push semantic HTML 5• Are they really important? – Today: No – Tomorrow: Who knows?• But this is a semantically correct way of reducing classes and extraneous divs
  48. Header
  49. HeaderPREVIOUSLY<div id="header"> <h1>The Awesome Blog of Awesome</h1> <p class="tagline">Awesome is a State of Mind</p></div>HTML 5<header> <h1>The Awesome Blog of Awesome</h1> <h2>Awesome is a State of Mind</h2></header>
  50. Footer
  51. FooterPREVIOUSLY<div id="footer”> <p>Copyright 2011 - Terry Ryan</p></div>HTML 5<footer> <p>Copyright 2011 - TerryRyan</p></footer>
  52. Navigation
  53. NavigationPREVIOUSLY HTML 5<div id="nav"> <nav> <ul> <ul> <li><a href="">Home</a></li> <li><a href="">Home</a></li> <li><a href="">Blog</a></li> <li><a href="">Blog</a></li> <li><a href="">About</a></li> <li><a href="">About</a></li> <li><a href="">Contact</a></li> <li><a href="">Contact</a></li> </ul> </ul></div> </nav>
  54. Articles
  55. ArticlesPREVIOUSLY HTML5<div class="post”> <article><div class="postheader"> <header> <h3><a href="">I Scream My Thoughts</a></h3> <h1><a href="">I Scream My Thoughts</a></h1> <p class="date">August 10, 2011</p> <time>August 10, 2011</time></div> </header><p>You probably havent heard of them duis</p> <p>You probably havent heard of them duis </p></div> </article>
  56. An article is apiece of content that canstand on it’s own
  57. Content 57
  58. ContentPREVIOUSLY HTML5<div class=”content”> <div class=”content”><div class="post”> <article>... ...</div> </article><div class="post”> <article>... ...</div> </article><div class="post”> <article>... ...</div> <article></div> </div>
  59. Also can be correctPREVIOUSLY HTML5<div class=”content”> <section class=”content”><div class="post”> <article>... ...</div> </article><div class="post”> <article>... ...</div> </article><div class="post”> <article>... ...</div> <article></div> </section>
  60. Umm That’s great, but frankly not that much of a different, how is that better?
  61. Benefit 1BEFORE THESE ELEMENTS AFTER </div> </div> </div> </article></div> </div><div id=“footer”> <footer></div> </footer></body> </body>
  62. Benefit 2• Less monkeying with content hierarchies
  63. <article> <header> <h1><a href="">I Made a Post Thingie</a></h1> article header h1 <time datetime="2011-09-02">September 2, 2011</time> </header> <img src="img/captain-awesome.jpg" width="300" height="200" alt="Image of Captain Awesome" /> <p>DIY ea nulla photo booth tempor occaecat, velit nihil mixtape scenester. Irony laboris echo park, wolf officia vice cupidatat labore butcher freegan farm-to-table nisi velit aliqua gluten-free. Aliquip nesciunt assumenda, wayfarers seitan wolf reprehenderit nulla twee sartorial dolore food truck voluptate ex vinyl. Aliquip ex enim, irony terry richardson trust fund consectetur fap pariatur dolor. Lo-fi nulla whatever mlkshk, banksy american apparel carles adipisicing incididunt wolf photo booth hipster. Wayfarers four loko ex cosby sweater, adipisicing sartorial non cardigan craft beer cillum reprehenderit terry richardson 3 wolf moon mollit. Ethical ut labore beard, 3 wolf moon duis readymade assumenda hipster tofu mcsweeneys master cleanse.</p></article>
  64. Benefit 3• No longer bound to one header or one nav can have multiple.
  65. New elements work across modern browsers without fail
  66. What’s you’redefinition of Modern?
  67. Use the HTML 5Shiv
  68. FORM
  69. HTML5 includes lots of new <input> types69
  70. They aren’t supported on every browser70
  71. All browsers default to showing unknown input types as text71
  72. Search<input type=“search” name=“search” />• Support is spotty• Browser vendors tend to round, add magnifying glass, etc.
  73. Email<input type=“email” name=“email” />• Provides validation• Provides email keyboard on iOS devices.
  74. Url<input type=“url” name=“url” />Provides validationProvides url keyboard on iOS devices.
  75. Number<input type=“number” name=“cost” />Provides keypad on iOS andAndroid devices.Provides a stepper on desktopsTakes attributes: – Min/Max – Step
  76. Tel<input type=“tel” name=“cell” />• Provides keypad on iOS and Android devices.
  77. Not wellsupported, but have potential
  78. Range<input type=“range” name=“volume” />• Provides a set of values• The slider allows you to pick one• Not terribly precise• Takes attributes: • Min/Max • Step
  79. Date<input type=“date” name=“dob” />• Provides validation• On Opera • Displays a data picker• On Safari/Chrome • Displays ticker• IE • Dashes your hopes and dreams the way only IE can
  80. FOR
  81. Output<output />Semantically correct placeholder forcalculated values.Can also be used a label for inputtype=“slider”
  82. Output in Action<form class="order"> <label for="quantity">Quantity:</label> <input id="quantity" name="quantity" type="number" value="1" onChange="calc()" /> <br /> <label for="price">Price: </label> <input id="price" name="price" type="number" value="19.99" disabled /> <br /> <label for="total">Total: </label> <output id="total" name="total" /> <br /></form><script type="application/javascript">function calc(){ var quantity = document.getElementById("quantity").value; var price = document.getElementById("price").value; var total = document.getElementById("total"); total.value = Math.round(quantity * price * 100)/100;}</script>
  83. meter<meter min=“0” max=“20” value=“12”>12cm</meter>Basically a Bar Chart of results
  84. progress<progress min=“100” value=“20”>20%</progress>Could be used to indicate progress througha multistep formCould be programmatically changed toindicate progress of program
  85. For Future Reference• HTML 5 General – –• HTML5 Semantics –• HTML 5 Forms – –
  87. Canvas
  88. Canvas• A drawing surface for – Manipulating images – Drawing – Saving Content
  89. Demo
  90. More resources forCanvas•••
  91. Video
  92. <Image>for movies
  93. Audio
  94. <image>for sounds
  95. Web Audio API
  96. <canvas>for sounds
  97. OTHERS
  98. Others• Offline Storage• Drag and Drop
  99. CSS3
  100. RememberCSS3 is a series of modules…
  101. CSS Modules• Transforms – Origins• Shadows• Gradients• Transitions• Animations
  102. Demo Various CSS Coolness
  103. Why CSS3?
  104. Reasons• Hardware Accelerated• Philosophically a display issue• Hardware Accelerated
  106. “HTML5” vs HTML5
  107. Follow up?• Preso will be up at –• Feel free to contact me – – – Twitter: @tpryan