1.79k likes | 1.87k Vues
Everyone’s going gaga over HTML5 and the plethora of how-tos and demos available on the web are inspirational, but often leave us with more questions than answers. In this session, Aaron Gustafson will focus his attention on HTML5 as a markup language, provide you with a solid context for its enhanced semantics, and show you simple, effective ways you can put it to use on your site today.
E N D
Smart Markup for Smarter Websites Aaron Gustafson Easy Designs, LLC @AaronGustafson slideshare.net/AaronGustafson
HTML5 gives you more control over your documents and apps
…but the end is near. June 2004 WhatWG begins work on Web Applications 1.0 2014 HTML5 Standard? May 2011 HTML5 to Last Call 2007 Work begins at W3C 2004 2014
fault tolerance n. a system’s ability to continue to operate when it encounters and unexpected error.
Browsers ignore what they don’t understand.
For example <input type="date" name="dob"/>
For example <video poster=”poster.png”> <source src=”video.m4v”/> <source src=”video.webm”/> <source src=”video.ogv”/> <img src=”poster.png” alt=””/> <ul> <li><a href="video.m4v">Download MP4</a></li> <li><a href="video.webm">Download WebM</a></li> <li><a href="video ogv">Download Ogg</a></li> </ul> </video>
A great idea that we lost. Albert Einstein <fig> <img src="photo.jpeg" alt=""/> <caption>Photo of Albert Einstein</caption> </fig> The original concept in HTML3: http://www.w3.org/MarkUp/html3/figures.html
Microformats brought it back. Albert Einstein <div class="figure"> <img class="image" src="photo.jpeg" alt=""/> <p class="caption">Albert Einstein</p> </div> The original “figure” microformat.
HTML5 re-imagined it. Albert Einstein <figure> <img src="photo.jpeg" alt=""/> <legend>Albert Einstein</legend> </figure> The original HTML5 figure.
Microformats adapted. Albert Einstein <div class="figure"> <img class="image" src="photo.jpeg" alt=""/> <p class="captionlegend">Albert Einstein</p> </div> The revised (and now draft) “figure” microformat: http://microformats.org/wiki/figure
Microformats adapted. Albert Einstein <figure> <img src="photo.jpeg" alt=""/> <figcaption>Albert Einstein</figcaption> </figure> The current (dare I say final?) HTML5 figure.
What’s the easiest way to write HTML5?
Use the new doctype <!DOCTYPE html>
The HTML4 Lexicon html meta head link style title base body dl dt dd b bdo script noscript map dfn object param p div ul ol li cite small iframe address area img br a pre code abbr kbd var q samp hr menu sup textarea ins del sub span strong select option optgroup label input form fieldset legend button i em blockquote h1 h2 h3 h4 h5 h6 table caption col colgroup tbody thead tfoot tr th td
The HTML5 Lexicon html meta head link style title base body dl dt dd section article b bdo script noscript map dfn aside details summary canvas nav audio figure object param p div ul ol li cite small video iframe address area img br a figcaption pre code abbr kbd var q samp hr menu header footer command sup time source datalist textarea ins del sub span strong select option optgroup label input output ruby progress form fieldset legend button i em mark meter hgroup blockquote h1 h2 h3 h4 h5 h6 wbr keygen embed table caption col colgroup rt rp tbody thead tfoot tr th td
Our focus today html meta head link style title base body dl dt dd section article b bdo script noscript map dfn aside details summary canvas nav audio figure object param p div ul ol li cite small video iframe address area img br a figcaption pre code abbr kbd var q samp hr menu header footer command sup time source datalist textarea ins del sub span strong select option optgroup label input output ruby progress form fieldset legend button i em mark meter hgroup blockquote h1 h2 h3 h4 h5 h6 wbr keygen embed table caption col colgroup rt rp tbody thead tfoot tr th td
Simplification The html element <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html lang="en">
Simplification Character encoding <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta charset="utf-8" />
Simplification Styles and scripts <link rel="stylesheet" href="style-original.css" type="text/css" /> <style type=”text/css”> /* … */ </style> <script type=”text/javascript” src=”myscript.js”></script> <link rel="stylesheet" href="style-original.css" /> <style> /* … */ </style> <script src=”myscript.js”></script>
Nip/tuck The em element Represents a span of text text with emphatic stress. <p>HTML5 introduces several <em>really</em> useful elements and a ton of new APIs.</p> The strong element Represents a span of text of great importance. <p>Please fill out the form below. <strong>Note: all fields are required.</strong></p>
Evil incarnate The small element Represents so-called “fine print” (e.g. disclaimers, caveats, etc.).
Clarification The cite element The title of a cited work (e.g. a book, magazine, or journal). <p>In <cite>Web Form Design</cite>, Luke Wroblewski draws on original research, his considerable experience at Yahoo! and eBay, and the perspectives of many of the field’s leading designers to show you everything you need to know about designing effective and engaging Web forms.</p>
Resurrection The b element Represents a span of text offset from its surrounding content, but of no extra importance. <p>This presentation is about <b>HTML5</b>.</p> The i element Represents a span of text in an alternate voice or mood. <p>The <code>b</code> and <code>i</code> elements have been legitimized in HTML5. <i>Go figure.</i></p>
Deeper meaning The hr element Represents a paragraph-level thematic break.
Organization The section element Represents a section of a document, typically with a title or heading. <section> <!-- pretty much anything can go here --> </section> The article element Represents a section of content that forms an independent part of a document or site. <article> <!-- pretty much anything can go here --> </article>
section 38
article 41
Organization The header element Represents the header of a section. <header> <!-- titles, etc. go here --> </header> The footer element Represents the footer of a section. <footer> <!-- meta/supplementary information goes here --> </footer>
header 45
footer 47
article 48
article 50