SlideShare a Scribd company logo
HTML5: What's new?
   Chris Mills, Opera Software




            Slides available on http://slideshare.net/chrisdavidmills
Who the hell am I?
‣ Opera open standards evangelist and tech writer
‣ Telling the world about open standards & Opera
‣ Improving web education
‣ Drinking beer & saving the world before morning
‣ Drumming in a heavy metal band
HTML5: what's new?
What is HTML5?
A new HTML spec that defines:
‣ New semantic elements
‣ New features such as native video, more
  powerful forms, web sockets
‣ New APIs for controlling such features
‣ Error handling, and other such useful things
There’s nothing wrong with
HTML4...




             http://www.flickr.com/photos/birdfarm/519230710/
But HTML5 has more bling
               As if! Not publishing this one...
HTML5 does not replace
HTML4
‣ It’s backwards compatible
‣ It fills up holes
‣ It adds new markup and APIs
‣ It competes with proprietary/plug-in technology
New syntax: better
semantics




             http://www.flickr.com/photos/zscheyge/49012397/
HTML5 doctype
<!doctype
html>
Typical website structure
<div
id="header"></div>
<div
id="nav"></div>
<div
id="main">


<div
class="article"></div>


<div
class="article"></div>




...
</div>
<div
id="footer"></div>
HTML5 update
<header></header>
<nav></nav>
<section
id="main">


<article></article>


<article></article>




...
</section>
<footer></footer>
<aside>
<aside>


<h2>About
the
author</h2>

 

<p>Chris
Mills
is
a
front‐end
bling
junkie





working
for
Opera
Software...</p>
</aside>
<time>
<p>Article
published
on
the



<time
datetime="2011‐03‐12T09:48">




12th
March
2011,
at
9:48am


</time>
</p>
<hgroup>
<hgroup>


<h1>Top
level
heading</h1>


<h2>This
is
a
really
descriptive
subtitle</h2>
</hgroup>
<figure> and <figcaption>
<figure>


<img
src="bear.jpg"







alt="this
is
the
bear
that
I
wrestled"
/>


<figcaption>This
is
the
bear
that
I


wrestled.</figcaption>
</figure>
Where does this leave the
humble <div>?
Use it for anything that isn’t covered by other new
elements, and is just a general grouping, e.g. for
styling purposes, for which you don’t want to
create a new section. An intro <div>, perhaps?
Browsers don’t ACTUALLY
support these ... yet
But we can get them displaying ok
‣ You can style any element with CSS, even if the
  browser doesn’t recognise it
‣ Give all the structural elements display:
block;
‣ IE also needs some scripting:
 createElement(‘article’);
‣ HTML5Shiv sorts it all out
New forms!




             http://www.flickr.com/photos/zscheyge/49012397/
HTML5 forms
Previously called Web Forms 2.0
‣ More powerful form controls
‣ Built-in validation
New input types
<input
type=range>
<input
type=date>
<input
type=number>
<input
type=color>
<input
type=search>
<input
type=email>
<input
type=url>
<input
type=tel>
Datalist
<input
type="text"
list="mydata">
<datalist
id="mydata">


<option
label="Mr"
value="Mister">


<option
label="Mrs"
value="Mistress">


<option
label="Ms"
value="Miss">
</datalist>
Validation
Form validation used to be horrendous

var
elements
=
document.getElementsByTagName('input');





//
loop
through
all
input
elements
in
form






Who the hell wants to write

for(var
i
=
0;
i
<
elements.length;
i++)
{







//
check
if
element
is
mandatory;
ie
has
a
pattern






var
pattern
=
elements.item(i).getAttribute('pattern');





this??



if
(pattern
!=
null)
{







var
value
=
elements.item(i).value;









//
validate
the
value
of
this
element,
using
its
defined
pattern







var
offendingChar
=
value.match(pattern);









//
if
an
invalid
character
is
found
or
the
element
was
left
empty







if(offendingChar
!=
null
||
value.length
==
0)
{











//
add
up
all
error
messages









str
+=
elements.item(i).getAttribute('errorMsg')
+
"n"
+
















"Found
this
illegal
value:
'"
+
offendingChar
+
"'
n";











//
notify
user
by
changing
background
color,
in
this
case
to
red









elements.item(i).style.background
=
"red";








}





}



}






if
(str
!=
"")
{





//
do
not
submit
the
form





alert("ERROR
ALERT!!n"
+str);






return
false;


HTML5 gives you this
<input
type="text"
required>
And this
<input
type="text"
required








pattern="[A‐z]{1,20}
[A‐z]{1,20}">
Other new attributes
autofocus
placeholder
min
max
step
New output mechanisms
<output>
<progress>
<meter>
<canvas>
Scriptable graphics
‣ Standard API for drawing
‣ Supporting across all modern browsers
The basics
<canvas
id="canvas"
width="400"
height="300">


...fallback...
</canvas>
The basics
var
ctx
=

document.getElementById('canvas').getContext('2d');

ctx.fillStyle
ctx.fillRect
<canvas> examples
‣ http://dev.opera.com/articles/view/html-5-
  canvas-the-basics/
‣ http://ejohn.org/blog/processingjs/
‣ http://www.hakim.se/experiments/
‣ http://www.canvasdemos.com/
‣ http://people.opera.com/patrickl/experiments/
  canvas/particle/3/
Video and audio!




             http://www.flickr.com/photos/zscheyge/49012397/
<video> and <audio>
New elements, plus new API for controlling audio
and video
The old school way
<object
width="425"
height="344">
<param
name="movie"

value="http://www.example.com/
v/LtfQg4KkR88&hl=en&fs=1"></param>
<param
name="allowFullScreen"
value="true"></param>
<embed
src="http://www.example.com/v/
LtfQg4KkR88&hl=en&fs=1"


type="application/x‐shockwave‐flash"


allowfullscreen="true"
width="425"

height="344"></embed>
</object>
The badass sexy new way
<video
src="video.webm"







width="480px"







height="283px"







controls







poster="poster.png">
</video>
Fallback
<video
src="video.webm"







width="480px"







height="283px"







controls







poster="poster.png">


<p>Your
browser
doesn’t
support
HTML5
video.
<a

href="myVideo.webm">Download
the
video
instead</
a>.</p>
</video>
Adding different formats
<video
width="480px"







height="283px"







controls







poster="poster.png">


<source
src="video.mp4"
type="video/mp4">


<source
src="video.webm"
type="video/webm">


<p>Your
browser
doesn’t
support
HTML5
video.
<a

href="myVideo.webm">Download
the
video
instead</
a>.</p>
</video>
Adding a Flash fallback
<object
type="application/x‐shockwave‐flash"

data="player.swf"
width="480"
height="283">


<param
name="allowfullscreen"
value="true">


<param
name="allowscriptaccess"
value="always">


<param
name="flashvars"
value="file=video.mp4">



                                                   



<!‐‐[if
IE]><param
name="movie"

value="player.swf"><![endif]‐‐>


<img
src="video.jpg"
width="480"
height="283"

alt="Video">
</object>
Captioning advancements
<track
src="sintel_en.srt"
kind="subtitles"

srclang="en"
label="English"
/>
<track
src="sintel_de.srt"
kind="subtitles"

srclang="de"
label="Deutsch"
/>
<track
src="sintel_es.srt"
kind="subtitles"

srclang="es"
label="Español"
/>
Going offline




                http://www.flickr.com/photos/zscheyge/49012397/
Offline apps!
‣ Generally, the web doesn't work very well
  without a web connection!
‣ What can we do about this?
Offline applications
‣ AppCache: Save an offline version of your web
  page files and use those to display your web
  page when you lose network.
‣ Web storage: Like cookies, but more powerful.
  Store things such as form data and user
  preferences
‣ WebSQL: A fully-functioning database in your
  browser. Store a user's data so they can
  continue working with it when the network goes
  down
Offline applications
‣ For more information, check out http://
 dev.opera.com/articles/view/taking-your-web-
 apps-offline-web-storage-appcache-websql/
And why is this all so good
again?




              http://www.flickr.com/photos/zscheyge/49012397/
Better consistency
‣ Better machine readability & interoperability:
 ‣ Easier syndication and reuse
 ‣ Less time worrying about design consistency
 ‣ Less time training up new team members
‣ Defined error handling means things work more
 consistently, even if they are broken!
 ‣ Better cross browser apps
 ‣ Less time spent debugging
Better accessibility
‣ For example, HTML5 video is keyboard
  accessible out of the box
‣ New elements bringing consistency is also
  important here
‣ Less time and money spent on accessibility
‣ 1 in 5 people in the UK have some kind of
  disability - a market you can’t ignore
Less reliance on JavaScript
‣ Less work for your developers to do, so faster
  implementation and prototyping
‣ Less pain for designers and other less technical
  team members
‣ Faster loading sites
Less reliance on Flash
‣ Means less skills needed in the team
‣ HTML5 plays nicer with the rest of the page; you
  can fill in any missing functionality with JS
‣ Less Flash means better accessibility (note: there
  are some HTML5 accessibility gotchas, like
  Canvas)
‣ Downloading a plugin breaks brand experience
  and can confuse users
HTML5 works on iDevices
‣ Like iPad and iPhone
‣ A crucial market to be in
‣ Flash has not been allowed on these devices
Offline apps!
‣ Never before possible...
Thanks for listening!
‣ cmills@opera.com
‣ @chrisdavidmills
‣ http://dev.opera.com/articles/tags/html5/
‣ http://html5doctor.com

More Related Content

What's hot (20)

PPTX
Untangling the web9
Derek Jacoby
 
PPTX
Advanced front end debugging with ms edge and ms tools
Chris Love
 
PDF
orcreatehappyusers
tutorialsruby
 
PPTX
Gherkin for test automation in agile
Viresh Doshi
 
PDF
HTML5 for PHP Developers - IPC
Mayflower GmbH
 
PDF
The What & Why of Pattern Lab
Dave Olsen
 
PPTX
10 things you can do to speed up your web app today 2016
Chris Love
 
PPT
Joomla as a mobile App backend - ideas, examples and experiences
Andy_Gaskell
 
PDF
Real solutions, no tricks
Jens Grochtdreis
 
PPTX
Disrupting the application eco system with progressive web applications
Chris Love
 
PPTX
Untangling7
Derek Jacoby
 
PDF
17 Web Performance Metrics You Should Care About
Evgeny Tsarkov
 
PDF
M is for modernization
Red Pill Now
 
PPTX
Untangling the web11
Derek Jacoby
 
PPTX
Delhi student's day
Ankur Mishra
 
PPTX
Develop a vanilla.js spa you and your customers will love
Chris Love
 
PPT
Web II - 01 - Introduction to server-side development
Randy Connolly
 
PPTX
Untangling spring week8
Derek Jacoby
 
PPTX
Untangling6
Derek Jacoby
 
PPTX
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB
 
Untangling the web9
Derek Jacoby
 
Advanced front end debugging with ms edge and ms tools
Chris Love
 
orcreatehappyusers
tutorialsruby
 
Gherkin for test automation in agile
Viresh Doshi
 
HTML5 for PHP Developers - IPC
Mayflower GmbH
 
The What & Why of Pattern Lab
Dave Olsen
 
10 things you can do to speed up your web app today 2016
Chris Love
 
Joomla as a mobile App backend - ideas, examples and experiences
Andy_Gaskell
 
Real solutions, no tricks
Jens Grochtdreis
 
Disrupting the application eco system with progressive web applications
Chris Love
 
Untangling7
Derek Jacoby
 
17 Web Performance Metrics You Should Care About
Evgeny Tsarkov
 
M is for modernization
Red Pill Now
 
Untangling the web11
Derek Jacoby
 
Delhi student's day
Ankur Mishra
 
Develop a vanilla.js spa you and your customers will love
Chris Love
 
Web II - 01 - Introduction to server-side development
Randy Connolly
 
Untangling spring week8
Derek Jacoby
 
Untangling6
Derek Jacoby
 
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB
 

Viewers also liked (8)

KEY
(For non-developers) HTML5: A richer web for everyone
Chris Mills
 
KEY
CSS3: the new style council
Chris Mills
 
PDF
HTML5 and CSS3 Shizzle
Chris Mills
 
KEY
CSS3: stay tuned for style
Chris Mills
 
PDF
HTML5 Pearson preso
Chris Mills
 
PDF
A web sized education problem?
Chris Mills
 
KEY
Selling Yourself Online Chrismills
Chris Mills
 
PPT
[Slideshare] tafaqqahu-#5(august-2016)-lesson-#3f-problem-in–education- contn...
Zhulkeflee Ismail
 
(For non-developers) HTML5: A richer web for everyone
Chris Mills
 
CSS3: the new style council
Chris Mills
 
HTML5 and CSS3 Shizzle
Chris Mills
 
CSS3: stay tuned for style
Chris Mills
 
HTML5 Pearson preso
Chris Mills
 
A web sized education problem?
Chris Mills
 
Selling Yourself Online Chrismills
Chris Mills
 
[Slideshare] tafaqqahu-#5(august-2016)-lesson-#3f-problem-in–education- contn...
Zhulkeflee Ismail
 
Ad

Similar to HTML5: what's new? (20)

PPTX
HTML5 - One spec to rule them all
Stu King
 
PPTX
Peter lubbers-html5-overview-sf-dev-conf-2011
Peter Lubbers
 
PPTX
HTML5 introduction for beginners
Vineeth N Krishnan
 
PPTX
Html5
Nisa Soomro
 
PPTX
HTML5 - Let’s make the WEB more powerful
Naga Harish M
 
PPTX
Html 5 Features And Benefits
Software Engineering
 
PPTX
Html5
Nisa Soomro
 
PPT
HTML5_3.ppt
NEILMANOJC1
 
PDF
Html 5 - What's new?
Bethmi Gunasekara
 
ODP
Bruce Lawson HTML5 South By SouthWest presentation
brucelawson
 
PPTX
HTML5- The Boosting Era of Web Development
MobilePundits
 
DOC
HTML5 vs Flash : Term paper at VGSOM, IIT Kharagpur
Kanishka Chakraborty
 
PPTX
HTML5 for dummies
Ran Bar-Zik
 
PDF
Html5
Ben MacNeill
 
PPT
Html5 drupal7 with mandakini kumari(1)
Mandakini Kumari
 
PPT
Html5
Fraboni Ec
 
PPT
Html5
Harry Potter
 
PPT
Html5
James Wong
 
PPT
Html5
Tony Nguyen
 
PPT
Html5
Hoang Nguyen
 
HTML5 - One spec to rule them all
Stu King
 
Peter lubbers-html5-overview-sf-dev-conf-2011
Peter Lubbers
 
HTML5 introduction for beginners
Vineeth N Krishnan
 
HTML5 - Let’s make the WEB more powerful
Naga Harish M
 
Html 5 Features And Benefits
Software Engineering
 
HTML5_3.ppt
NEILMANOJC1
 
Html 5 - What's new?
Bethmi Gunasekara
 
Bruce Lawson HTML5 South By SouthWest presentation
brucelawson
 
HTML5- The Boosting Era of Web Development
MobilePundits
 
HTML5 vs Flash : Term paper at VGSOM, IIT Kharagpur
Kanishka Chakraborty
 
HTML5 for dummies
Ran Bar-Zik
 
Html5 drupal7 with mandakini kumari(1)
Mandakini Kumari
 
Html5
Fraboni Ec
 
Html5
James Wong
 
Ad

More from Chris Mills (20)

PDF
More efficient, usable web
Chris Mills
 
PDF
Feedback handling, community wrangling, panhandlin’
Chris Mills
 
PDF
APIs for modern web apps
Chris Mills
 
PDF
APIs, now and in the future
Chris Mills
 
PDF
Guerrilla education
Chris Mills
 
PDF
Web versus Native: round 1!
Chris Mills
 
PDF
BrazilJS MDN
Chris Mills
 
PDF
Empowering the "mobile web"
Chris Mills
 
PDF
Documentation and publishing
Chris Mills
 
PDF
MDN is easy!
Chris Mills
 
PDF
Getting rid of images with CSS
Chris Mills
 
PDF
Future layouts
Chris Mills
 
PDF
Laying out the future
Chris Mills
 
PDF
Accessibility doesn't exist
Chris Mills
 
PDF
Responsive web design standards?
Chris Mills
 
PDF
Adapt! Media queries and viewport
Chris Mills
 
PDF
Adapt and respond: keeping responsive into the future
Chris Mills
 
KEY
Angels versus demons: balancing shiny and inclusive
Chris Mills
 
PDF
HTML5 and CSS3: does now really mean now?
Chris Mills
 
PDF
The W3C and the web design ecosystem
Chris Mills
 
More efficient, usable web
Chris Mills
 
Feedback handling, community wrangling, panhandlin’
Chris Mills
 
APIs for modern web apps
Chris Mills
 
APIs, now and in the future
Chris Mills
 
Guerrilla education
Chris Mills
 
Web versus Native: round 1!
Chris Mills
 
BrazilJS MDN
Chris Mills
 
Empowering the "mobile web"
Chris Mills
 
Documentation and publishing
Chris Mills
 
MDN is easy!
Chris Mills
 
Getting rid of images with CSS
Chris Mills
 
Future layouts
Chris Mills
 
Laying out the future
Chris Mills
 
Accessibility doesn't exist
Chris Mills
 
Responsive web design standards?
Chris Mills
 
Adapt! Media queries and viewport
Chris Mills
 
Adapt and respond: keeping responsive into the future
Chris Mills
 
Angels versus demons: balancing shiny and inclusive
Chris Mills
 
HTML5 and CSS3: does now really mean now?
Chris Mills
 
The W3C and the web design ecosystem
Chris Mills
 

Recently uploaded (20)

PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
Next Generation AI: Anticipatory Intelligence, Forecasting Inflection Points ...
dleka294658677
 
PDF
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
Software Development Company Keene Systems, Inc (1).pdf
Custom Software Development Company | Keene Systems, Inc.
 
PDF
Home Cleaning App Development Services.pdf
V3cube
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
PPTX
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
Next Generation AI: Anticipatory Intelligence, Forecasting Inflection Points ...
dleka294658677
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Software Development Company Keene Systems, Inc (1).pdf
Custom Software Development Company | Keene Systems, Inc.
 
Home Cleaning App Development Services.pdf
V3cube
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 

HTML5: what's new?

Editor's Notes