SlideShare a Scribd company logo
1 of 122
HTML5

                    What it is, what it’s not, and what parts of it we can use today.




October 21, 2010
Steven G. Chipman
In 140 Characters ....

    “HTML5 is a vocabulary and set of application programming interfaces that
        make up a core declarative language for web sites and applications.”

                                                              @mollydotcom
Simplification.
You’re no doubt familiar with ...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html>
(seriously, thats it.)
<meta charset=”UTF-8”>
<script src=”foo.js”></script>
<link rel=”stylesheet” href=”styles.css” />
<html lang=”en”>
HTML5 is not XML
<DIV>, <div> or even <DiV> is just fine.
<br>, <BR> and <br /> are all ok too.
<a class=foo> is even all right.
(but it seems dirty to me)
Obsolescence.
frame, frameset and noframes
(but when was the last time you needed them?)
font, center, and other presentational cruft
(but if you still use those, I’ll give you a smack)
Changes.
small is now semantic. It means “legal text”.
b now means stylistically offset text with no
        additional importance.
i means the text is in an alternate mood or voice
cite now means the “title of a work”
It’s now ok to nest elements inside an a element
<a href=”/”>

 <h1>My awesome site</h1>

 <h2>My witty tagline</h2>
</a>
* we can make this more semantic, but lets not get ahead of ourselves.
<menu>
<menu type=”list|toolbar|context”>
<command label=”Autofill” onclick=”doAutoFill();” />
* doesn’t seem to be supported by anything yet
<form contextmenu=”ourMenu”>

 ....

 <menu id=”ourMenu”>

 
 <command ... />

 </menu>
</form>
Semantics.
<time>
<time datetime=”2010-10-21”>October 21, 2010</
                    time>
<time datetime=”2010-10-21”>Thursday</time>
<time datetime=”2010-10-21” pubdate>October 21, 2010</time>

* if nested in an <article>, its the pubdate of the article. Otherwise, its the pubdate of the document
<meter>
<meter>4 out of 5 dentists</meter>
<meter min=”0” max=”5”>4 out of 5 dentists</meter>
<meter min=”0” max=”5” value=”4”>A majority of dentists</meter>
It also has high, low, and optimum
              attributes.
<progress>
<p>

 Upload is <progress min=”0” max=”100”>60%</progress> complete.
</p>
<progress min=”0” max=”100” value=”60”></
                 progress>
<section>
Use section it to group related content.
<section class=”posts”>

 <h1>The latest news ... </h1>

 <p>

 
 Oh hai, guyz!

 </p>
</section>
<article>
Like section, but for self contained content.
<section class=”posts”>

 <h1>The latest news ... </h1>

 <article>

 
 <p>

 
 
 Oh hai, guyz!

 
 </p>

 </article>
</section>
Each article can have its own h1-h6 hierarchy.
<section class=”posts”>

 <h1>The latest news ...</h1>

 <article>

 
 <h1>Article title</h1>

 
 <p>

 
 
 Oh hai, guyz!

 
 </p>

 </article>
</section>
<header>
<hgroup>
<header>

 <hgroup>

 
 <a href=”/”>

 
 
 <h1>My awesome site</h1>

 
 
 <h2>My witty tagline</h2>

 
 </a>

 </hgroup>
</header>
* the enhanced semantics I mentioned earlier
<footer>
<footer>

 <small>Legal mumbo jumbo and copyrights</small>
</footer>
<nav>
<footer>

   <nav>

   
  <ul>

   
  
   <li><a href=”...”>Another Property</li>

   
  
   <li><a href=”...”>Help!</li>

   
  </ul>

   </nav>

   <small>Legal mumbo jumbo and copyrights</small>
</footer>
<aside>
Used to represent content that is tangentially
related to other content.
<!DOCTYPE html>
<head>
<meta charset=”UTF-8” />
<title>Sample HTML5 Document Structure</title>
</head>
<body>
<header>

     <hgroup>

     
     <h1>My awesome site</h1>

     
     <h2>My witty tagline</h2>

     </hgroup>

     <nav>

     
     <ul>

     
     
    <li><a href=”/”>home</a></li>

     
     
    <li><a href=”about.html”>about</a></li>

     
     </ul>

     </nav>
</header>
<section class=”posts”>

     <article>

     
     <h1>Post Title</h1>

     
     <time datetime=”2010-10-01”>October 1, 2010</time>

     
     <p>This is the body of the blog post.</p>

     
     <aside>Here is a funny excerpt!</aside>

     </article>
</section>
<footer>

     <nav>

     
     <ul>

     
     
    <li><a href=”...”>Another Property</a></li>

     
     
    <li><a href=”...”>Help!</a></li>

     
     </ul>

     </nav>

     <small>&copy; 2010, Me</small>
</footer>
</body>
</html>
Forms.
<input type=”text” placeholder=”Email” />
<input type=”text” placeholder=”Email” autofocus />
<input type=”email” placeholder=”Email” autofocus />
<input type=”email” placeholder=”Email” autofocus required />
input:invalid {

 background-color:#E366AF
}
tel
url
datetime
date
month
week
time
datetime-local
number
range
color
search
<input type=”range” min=”0” max=”10” />
<input type=”date” />
<datalist>
<input type=”text” list=”titles” />

   <datalist id=”titles”>

   
 <option value=”Mr.” />

   
 <option value=”Mrs.” />

   
 <option value=”Dr.” />

   </datalist>
Browsers that don’t understand an input type will
render it as a standard text input.
Media.
<video>
<video src=”movie.mp4” width=”320” height=”240” poster=”poster.jpg”>
</video>
<video controls src=”movie.mp4” width=”320” height=”240” poster=”poster.jpg”>
</video>
If you don’t specify controls, you can write your own
with javascript.

               *Standard stuff like .play(), .pause(), .volume, etc.
<video preload=”none|auto|metadata” src=”movie.mp4” width=”320”
height=”240” poster=”poster.jpg”>
</video>
<video controls width=”320” height=”240” poster=”poster.jpg”>

 <source src=”movie.mp4” type=”video/mp4” />

 <source src=”move.ogv” type=”video/ogg” />
</video>
<video controls width=”320” height=”240” poster=”poster.jpg”>

 <source src=”movie.mp4” type=”video/mp4” />

 <source src=”move.ogv” type=”video/ogg” />

 <object type=”application/x-shockwave-flash”>

 
 ...

 </object>
</video>
http://slayeroffice.com/articles/html5/video/
<audio>
pretty much the same as video.
<canvas>
http://slayeroffice.com/code/mouse_patterns/mp-canvas.html
APIs.
Canvas 2d Context
An introduction to canvas is a presentation unto itself.
window.localStorage
localStorage.setItem(“key”,”value”);
localStorage.getItem(“key”);
* returns null if the key doesn’t exist
localStorage.removeItem(“key”);
window.addEventListener(“storage”,onStorage,false);
StorageEvent.key|oldValue|newValue|url
* url might be uri in some browsers. Check for uri if url isn’t there.
Things to keep in mind ...

• 5MB of storage


• EVERYTHING is returned as as string, just like cookies


• If you run out of space, an exception will be thrown.


• Unlike Flash LSOs, you can’t ask for more space.


• Some browsers allow users to set the limit, so you may have less than 5MB
File API
Drag & Drop Events
Geolocation
navigator.geolocation.getCurrentPosition(callback);
function callback(position) {

 alert(position.coords.latitude)
}
navigator.geolocation.watchPosition(callback);
Web Workers
Javascript is single threaded.
Workers allow for background threads.
var worker = new Worker(“worker.js”);
worker.postMessage(“hello!”);
worker.onmessage = function(evt) {

 
 alert(evt.data);
}
self.onmessage = function(evt) {

 
 // do stuff ...
}
Things to be aware of ...

• Workers can not access or manipulate the DOM.


• They do not have access to the scripts in the page that spawned it.


• Using importScripts, a Worker can access other javascript libraries.
Web Sockets
Also an entire presentation.
In a nutshell, it will allow us to use
sockets instead of long polling over
HTTP.
But only Safari and Chrome support it right now.
But what about ...
Getting IE to recognize new elements ...

<script>
     document.createElement(“section”);
     document.createElement(“article”);
     // ... and so on
</script>
* otherwise you won’t be able to style these elements in IE8 and below
Testing for attribute support ...

function elementSupportsAttribute(element,attribute) {
     var ele = document.createElement(element);
     return attribute in ele ? true : false;
}
Testing for input type support ...

function elementSupportsType(type) {
     var input = document.createElement(“input”);
     input.setAttribute(“type”,type);
     return input.getAttribute(“type”) == “text” ? false : true;
}
According to Microsoft ...

IE9 is the bomb: http://samples.msdn.microsoft.com/ietestcenter/
Modernizr

• Detects support, does NOT provide it


• Javascript hooks such as Modernizr.canvas


• Adds classes to the HTML element that define available features


• Sets up elements for IE 6 through 8


• MIT-BSD License
Resources

• HTML5 for Web Designers by Jeremy Keith - http://books.alistapart.com/


• Dive into HTML5 by Mark Pilgrim - http://diveintohtml5.org/


• The Spec: http://dev.w3.org/html5/spec/Overview.html


• The HTML5 Test: http://www.html5test.com/


• Modernizr: http://www.modernizr.com/
Questions?

Thanks for coming!

More Related Content

What's hot

Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Terry Ryan
 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtml
sagaroceanic11
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)
Joseph Lewis
 

What's hot (20)

Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview
 
Html5 Basic Structure
Html5 Basic StructureHtml5 Basic Structure
Html5 Basic Structure
 
HTML5
HTML5HTML5
HTML5
 
Html5 Basics
Html5 BasicsHtml5 Basics
Html5 Basics
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
 
HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtml
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 
HTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookHTML 5 Step By Step - Ebook
HTML 5 Step By Step - Ebook
 
New Elements & Features in HTML5
New Elements & Features in HTML5New Elements & Features in HTML5
New Elements & Features in HTML5
 
HTML5 & Friends
HTML5 & FriendsHTML5 & Friends
HTML5 & Friends
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)
 
Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)
 
HTML5 Introduction
HTML5 IntroductionHTML5 Introduction
HTML5 Introduction
 
HTML5 & CSS3
HTML5 & CSS3 HTML5 & CSS3
HTML5 & CSS3
 
Html 5
Html 5Html 5
Html 5
 

Viewers also liked

Introdution to HTML 5
Introdution to HTML 5Introdution to HTML 5
Introdution to HTML 5
onkar_bhosle
 
Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)
club23
 

Viewers also liked (20)

HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS Basics
 
Jquery
JqueryJquery
Jquery
 
Frames tables forms
Frames tables formsFrames tables forms
Frames tables forms
 
JavaScript Operators
JavaScript OperatorsJavaScript Operators
JavaScript Operators
 
Introdution to HTML 5
Introdution to HTML 5Introdution to HTML 5
Introdution to HTML 5
 
HTML/CSS/java Script/Jquery
HTML/CSS/java Script/JqueryHTML/CSS/java Script/Jquery
HTML/CSS/java Script/Jquery
 
COTS V Model
COTS V ModelCOTS V Model
COTS V Model
 
JavaScript: Operators and Expressions
JavaScript: Operators and ExpressionsJavaScript: Operators and Expressions
JavaScript: Operators and Expressions
 
Arrays in PHP
Arrays in PHPArrays in PHP
Arrays in PHP
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
JavaScript: Events Handling
JavaScript: Events HandlingJavaScript: Events Handling
JavaScript: Events Handling
 
Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)
 
Basic JavaScript Tutorial
Basic JavaScript TutorialBasic JavaScript Tutorial
Basic JavaScript Tutorial
 
Sessions and cookies
Sessions and cookiesSessions and cookies
Sessions and cookies
 
The Future of CSS Layout
The Future of CSS LayoutThe Future of CSS Layout
The Future of CSS Layout
 
Javascript
JavascriptJavascript
Javascript
 
Cookie and session
Cookie and sessionCookie and session
Cookie and session
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
 
HTTP Basics
HTTP BasicsHTTP Basics
HTTP Basics
 

Similar to An Introduction to HTML5

HTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - AltranHTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - Altran
Robert Nyman
 
Fronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateFronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-template
Inventis Web Architects
 
jQtouch, Building Awesome Webapps
jQtouch, Building Awesome WebappsjQtouch, Building Awesome Webapps
jQtouch, Building Awesome Webapps
Home
 

Similar to An Introduction to HTML5 (20)

HTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - AltranHTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - Altran
 
HTML5 workshop, part 1
HTML5 workshop, part 1HTML5 workshop, part 1
HTML5 workshop, part 1
 
Using HTML5 sensibly
Using HTML5 sensiblyUsing HTML5 sensibly
Using HTML5 sensibly
 
Fronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateFronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-template
 
Zotero Framework Translators
Zotero Framework TranslatorsZotero Framework Translators
Zotero Framework Translators
 
#3 HTML & CSS [know-how]
#3 HTML & CSS [know-how]#3 HTML & CSS [know-how]
#3 HTML & CSS [know-how]
 
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
 
Html5, a gentle introduction
Html5, a gentle introduction Html5, a gentle introduction
Html5, a gentle introduction
 
HTML5 Essentials
HTML5 EssentialsHTML5 Essentials
HTML5 Essentials
 
HTML5 New and Improved
HTML5   New and ImprovedHTML5   New and Improved
HTML5 New and Improved
 
Html 5, a gentle introduction
Html 5, a gentle introductionHtml 5, a gentle introduction
Html 5, a gentle introduction
 
#1 HTML [know-how]
#1 HTML [know-how]#1 HTML [know-how]
#1 HTML [know-how]
 
What you need to know bout html5
What you need to know bout html5What you need to know bout html5
What you need to know bout html5
 
jQtouch, Building Awesome Webapps
jQtouch, Building Awesome WebappsjQtouch, Building Awesome Webapps
jQtouch, Building Awesome Webapps
 
HTML5
HTML5HTML5
HTML5
 
Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~
 
关于 Html5 那点事
关于 Html5 那点事关于 Html5 那点事
关于 Html5 那点事
 
Html5
Html5Html5
Html5
 
Html5 101
Html5 101Html5 101
Html5 101
 
Frontend for developers
Frontend for developersFrontend for developers
Frontend for developers
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

An Introduction to HTML5

Editor's Notes