html5 smart markup for smarter websites [fowd nyc 2011]

143
Smart Markup for Smarter Websites Aaron Gustafson @aarongustafson slideshare.net/AaronGustafson

Upload: aaron-gustafson

Post on 27-Jan-2015

106 views

Category:

Technology


2 download

DESCRIPTION

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.

TRANSCRIPT

Page 2: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 3: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 4: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

This is not a consensus-based approach — there’s no guarantee that everyone will be happy! There is also no voting.

— WHATWG process

Page 5: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 6: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

<time>

Page 7: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

<time>

Page 8: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

<time>Use

anyway.

Page 9: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

In case of conflict, consider users over authors over implementors over specifiers over theoretical purity.

— HTML design principle

Page 10: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

2004 2014

June 2004WhatWG begins work on Web Applications 1.0

2007Work begins at W3C

2014HTML5 Standard?

May 2011HTML5 to Last Call

Page 11: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 12: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 13: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

fault tolerancen. a system’s ability to continue to operate when it encounters and unexpected error.

Page 14: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 15: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 16: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 17: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

Browsers ignore what they don’t

understand

Page 18: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Fault tolerance<p>HTML5 introduces several <em>really</em> useful elements and a ton of new APIs.</p>

<p>Please fill out the form below. <strong>Note: all fields are required.</strong></p>

<p>I like to work with markup languages because <strong>they are simple and easy to read</strong>. They also have that certain <i lang="fr" title="I don&#8217;t know what">je ne sais quoi</i>.</p>

Page 19: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Fault toleranceHTML5 introduces several reallyuseful elements and a ton of new APIs.

Please fill out the form below. Note: all fields are required.

I like to work with markup languages because they are simple and easy to read. They also have that certain je ne sais quoi.

Page 20: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Fault tolerance<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>

Page 21: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Fault tolerance

<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>

Page 22: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Fault tolerance<input type="date" name="dob"/>

I get it! I don’t get it :-(

Page 23: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

You are already using HTML5

Page 24: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

HTML5 == HTML 4

Page 25: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

HTML5 == HTML 3

Page 26: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

HTML5 == HTML 2

Page 27: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

HTML5 == HTML 1

Page 28: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

HTML5 == HTML 0

Page 29: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

HTML 4.01

aabbraddress area

blockquote

body

br

button

caption

code

col colgroup

dd

del

dfndiv

dl dt

fieldsetformh1 h2 h3 h4 h5 h6

headhtml

iframe img

inskbd

labellegend

li

link

map

meta

noscriptobject ol

optgroupoption

pparam

pre q samp

script

selectspan

style

sub

tabletbody

td

textarea

tfootth

thead

title

tr

ul

var

basebdo b

cite

hr menustrongsup

i small

u eminput

Page 30: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

HTML5

aabbraddress area

blockquote

body

br

button

caption

code

col colgroup

dd

del

dfndiv

dl dt

fieldsetformh1 h2 h3 h4 h5 h6

headhtml

iiframe img

inputins

kbd

labellegend

li

link

map

meta

noscriptobject ol

optgroupoption

pparam

pre q samp

script

selectspan

style

sub

tabletbody

td

textarea

tfootth

thead

title

tr

ul

var

basebdo b

cite

em

hr menusmall

strong

articleaside

audiocanvas

commanddatalist

details

embed

figcaptionfigurefooterheader

hgroupkeygen

mark meter

nav

output progress

rprt

ruby

section

source

summary

time

video

wbr

sup

u

Page 31: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Our focus today

aabbraddress area

blockquote

body

br

button

caption

code

col colgroup

dd

del

dfndiv

dl dt

fieldsetformh1 h2 h3 h4 h5 h6

headhtml

iframe img

inskbd

labellegend

li

link

map

meta

noscriptobject ol

optgroupoption

pparam

pre q samp

script

selectspan

style

sub

tabletbody

td

textarea

tfootth

thead

title

tr

ul

var

basebdo b

cite

hr menustrong

articleaside

audiocanvas

commanddatalist

details

embed

figcaptionfigurefooterheader

hgroupkeygen

mark meter

nav

output progress

rprt

ruby

section

source

summary

time

video

wbr

sup

i small

u eminput

Page 32: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

What’s the easiest way to

“switch” a site to HTML5?

Page 33: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Switching to HTML5<!DOCTYPE html>

Page 34: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

Simpli!cation

Page 35: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Simpli!cation<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<html lang="en">

Page 36: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Simpli!cation<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<meta charset="utf-8" />

Page 37: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Simpli!cation<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>

Page 38: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

Rede!nition

Page 39: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Rede!nition

<p>HTML5 introduces several <em>really</em> useful elements and a ton of new APIs.</p>

The em elementRepresents a span of text text with emphatic stress.

<p>Please fill out the form below. <strong>Note: allfields are required.</strong></p>

The strong elementRepresents a span of text of great importance.

Page 40: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Rede!nition

<p>This presentation is about <b>HTML5</b>.</p>

The b elementRepresents a span of text offset from its surrounding content, but of no extra importance.

<p>The <code>b</code> and <code>i</code> elementshave been legitimized in HTML5. <i>Go figure.</i></p>

The i elementRepresents a span of text that is borrowed or in an alternate voice or mood.

<p>I like to work with markup languages because <strong>they are simple and easy to read</strong>. They also have that certain <i lang="fr" title="I don&#8217;t know what">je ne sais quoi</i>.</p>

Page 41: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Rede!nition

<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>

The cite elementThe title of a cited work (e.g. a book, magazine, or journal).

Page 42: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Rede!nitionThe small elementRepresents so-called “!ne print”(e.g. disclaimers, caveats, etc.).

Page 43: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Rede!nitionThe hr elementRepresents a paragraph-level thematic break.

Page 44: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

Organization

Page 45: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Organization<section> <!-- pretty much anything can go here --></section>

<article> <!-- pretty much anything can go here --></article>

Page 46: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 47: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

section

Page 48: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

section > article

Page 49: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 50: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

article

Page 51: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

article > section

Page 52: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Organization<header> <!-- titles, etc. go here --></header>

<footer> <!-- meta/supplementary information goes here --></footer>

Page 53: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 54: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

header

Page 55: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 56: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

footer

Page 57: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

article

Page 58: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

article > header

Page 59: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

article

Page 60: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

article > footer

Page 61: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Organization<nav> <ol> <li><a href="#details">Details</a></li> <li><a href="#lodging">Lodging</a></li> <li><a href="#location">Location</a></li> <li><a href="#topics">Topics</a></li> <li><a href="#contact">Contact Us</a></li> </ol> <p><a href="register">Register Now</a> <b>Only 5 spaces left</b></p></nav>

Page 62: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 63: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

nav

Page 64: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 65: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

nav

Page 66: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Organization<article>

<!-- main content -->

<aside> <!-- something related --> </aside>

</article>

Page 67: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 68: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

aside

Page 69: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Organization<figure id="fig-1"> <img src="photo.jpeg" alt=""/> <figcaption>Photo of Albert Einstein</figcaption></figure>

<figure id="fig-2"> <table> <caption>2011 Forecast Earnings</caption> <!-- a bunch of data --> </table></figure>

Page 70: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 71: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Implicit sections (HTML 4)<h1> HTML5<p> HTML5 is currently under development...<p> Like its immediate predecessors, HTML...

<h2> W3C standardization process<p> The Web Hypertext Application...<p> The HTML5 specification...<p> According to the W3C timetable...<p> Ian Hickson, editor of the HTML5...

<h2> Markup<p> HTML5 introduces a number of...<p> The HTML5 syntax is no longer...

1 HTML51.1 W3C standardization process1.2 Markup

Page 72: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Explicit sections (HTML5)<h1> HTML5<p> HTML5 is currently under development...<p> Like its immediate predecessors, HTML...

<h2> W3C standardization process<p> The Web Hypertext Application...<p> The HTML5 specification...<p> According to the W3C timetable...<p> Ian Hickson, editor of the HTML5...

<h2> Markup<p> HTML5 introduces a number of...<p> The HTML5 syntax is no longer...

sect

ion

sect

ion

1 HTML51.1 W3C standardization process1.2 Markup

Page 73: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Explicit sections (HTML5)<h1> HTML5<p> HTML5 is currently under development...<p> Like its immediate predecessors, HTML...

<h1> W3C standardization process<p> The Web Hypertext Application...<p> The HTML5 specification...<p> According to the W3C timetable...<p> Ian Hickson, editor of the HTML5...

<h1> Markup<p> HTML5 introduces a number of...<p> The HTML5 syntax is no longer...

sect

ion

sect

ion

1 HTML51.1 W3C standardization process1.2 Markup

Page 74: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Explicit sections (HTML5)<h1> HTML5<p> HTML5 is currently under development...<p> Like its immediate predecessors, HTML...

<h4> W3C standardization process<p> The Web Hypertext Application...<p> The HTML5 specification...<p> According to the W3C timetable...<p> Ian Hickson, editor of the HTML5...

<h6> Markup<p> HTML5 introduces a number of...<p> The HTML5 syntax is no longer...

sect

ion

sect

ion

1 HTML51.1 W3C standardization process1.2 Markup

Page 75: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Sections๏ section

๏ article

๏ aside

๏ footer

๏ header

๏ nav

75

Page 76: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Outline limitations in HTML4

1 Title1.1 Subtitle

<h1> Title<h2> Subtitle<p> Text content continues...<p> Text content continues...<p> Text content continues...<p> Text content continues...<p> Text content continues...<p> Text content continues...<p> Text content continues...

Page 77: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Heading groups (HTML5)<h1> Title<h2> Subtitle<p> Text content continues...<p> Text content continues...<p> Text content continues...<p> Text content continues...<p> Text content continues...<p> Text content continues...<p> Text content continues...

hgro

up

1 Title

Page 78: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Aside: rooted sections

1 Title1.1 Section heading

<h1> Title<p> Text content continues...<p> Text content continues...

<h2> Section heading<p> Text content continues...<blockquote> <h2> Rooted heading <p> Text content continues... <p> Text content continues...<p> Text content continues...<p> Text content continues...

Page 79: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Sectioning roots๏ body

๏ blockquote

๏ details

๏ fieldset

๏ figure

๏ td

79

Page 80: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

Accessibility

Page 81: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 82: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

What is it?

Page 83: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

What is it?

Page 84: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

What is it?

<button>Tweet</button>

<a class=”button”>Tweet</a>

<button>Tweet</button>

Page 85: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

What is it?

<button>Tweet</button>

<a class=”button”>Tweet</a>

Page 86: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

What is it?

Page 87: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

What is it?

Page 88: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

What is it?

<button>Search Mail</button>

<div>Search Mail</div>

<button>Search Mail</button>

Page 89: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

What is it?

<button>Search Mail</button>

<div>Search Mail</div>

Page 90: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

ARIA maps the OS to the web

Page 91: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

Semantics+

Page 92: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

All the web’s a play…<section id="main" role="main"> <!-- The primary content for the page would go here --></section>

Page 93: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 94: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

<header role="banner">

Page 95: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

<nav role="navigation">

Page 96: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

<form role="search">

Page 97: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

<section role="main">

Page 98: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Semantic comparisonAd-hoc ARIA Role HTML5

#header, #top banner header (kind of)

#main, #content main none

#extra, .sidebar complementary, note aside

#footer, #bottom contentinfo footer

#nav navigation nav

.hentry article article

Page 99: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 100: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

These are the droids you seek<span role="button">OK</span>

<div role="alert"> <p>Something went wrong.</p></div>

<div role="alertdialog"> <p>Something went wrong.</p> <img src="x.png" alt="dismiss" role="button" /></div>

Page 101: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

What is it?

<a role=”button”>Tweet</a><a class=”button”>Tweet</a>

Page 102: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

What is it?

<a role=”button”>Tweet</a>

Page 103: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

96

Page 104: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

97

Page 105: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 106: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

What’s happening?

<span> <img src="bold-off.png" alt="bold" /></span><span> <img src="bold-on.png" alt="bold" /></span>

B(off)

B(on)

Page 107: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

What’s happening?

<span> <img src="bold-off.png" alt="not bold" /></span><span> <img src="bold-on.png" alt="bold" /></span>

B(off)

B(on)

Page 108: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

What’s happening?

<span role="button" aria-pressed="false"> <img src="bold-off.png" alt="not bold" /></span><span role="button" aria-pressed="true"> <img src="bold-on.png" alt="bold" /></span>

B(off)

B(on)

Page 109: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 110: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Hey! Over here!

Page 111: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Hey! Over here!

<input class="tweet-counter" value="140" disabled="disabled">

Page 112: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Hey! Over here!

<span id="chars_left_notice" class="numeric"> <strong id="status-field-char-counter" class="char-counter">140</strong></span>

Page 113: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Hey! Over here!

<span class="tweet-counter">140 <b class="hidden"> characters remaining</b></span>

.hidden { position: absolute; left: −999em;}

Page 114: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Hey! Over here!

<span class="tweet-counter">maximum of 140 characters</span>

<span class="tweet-counter">140 <b class="hidden"> characters remaining</b></span>

Page 115: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Hey! Over here!

<span aria-live="polite" aria-atomic="true" class="tweet-counter">140<b class="hidden"> characters remaining</b></span>

Page 116: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Hey! Over here!

Page 117: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

Expansion

Page 118: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 119: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

time

Page 120: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<time>October 25, 2010 8:11 PM</time>

9+ 4+ 6+ 5+ 11.1+

Page 121: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<time datetime="2010-10-25T20:11:00-05:00"> October 25, 2010 8:11 PM</time>

9+ 4+ 6+ 5+ 11.1+

Page 122: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<time datetime="2010-10-25T20:11:00-05:00" pubdate="pubdate">October 25, 2010 8:11 PM</time>

9+ 4+ 6+ 5+ 11.1+

Page 123: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 124: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Page 125: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

mark

Page 126: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

mark

Page 127: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<ol id="search-results"> <li> <h3><a href="...">Web Upgrade <mark>HTML5</mark> May Weaken Privacy</a></h3> <p>The new language, <mark>HTML5</mark>, could give marketers access to many more details about users' online activities.</p> </li></ol>

9+ 4+ 6+ 5+ 11.1+

Page 128: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion

<input type="email" …/> <input type="url" …/>

Page 129: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<input type="date" name="dob"/>

Page 130: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<input type="number" name="foo"/>

<input type="range" min="1" max="11" name="foo"/>

Page 131: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<input type="text" pattern="\d{6}\w{3}" placeholder="6 digits followed by 3 letters" .../>

Page 132: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<input type="text" list="countries" name="country"/><datalist id="countries"> <option>Afghanistan</option> <option>Åland Islands</option> <!-- ... --></datalist>

Page 133: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<audio src="my.oga" controls="controls"></audio>

Page 134: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<audio controls="controls"> <source src="my.mp3"/> <source src="my.oga"/> <!-- fallback --></audio>

Page 135: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<audio controls="controls" autobuffer="autobuffer" preload="auto"> <source src="my.mp3"/> <source src="my.oga"/> <!-- fallback --></audio>

Page 136: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<audio controls="controls" autobuffer="autobuffer" preload="auto"> <source src="my.mp3"/> <source src="my.oga"/> <ul> <li><a href="my.mp3">Download MP3</a></li> <li><a href="my.oga">Download Ogg</a></li> </ul></audio>

Page 137: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<audio controls="controls" autobuffer="autobuffer" preload="auto"> <source src="my.mp3"/> <source src="my.oga"/> <object …> <!-- flash player goes here --> <ul> <li><a href="my.mp3">Download MP3</a></li> <li><a href="my.oga">Download Ogg</a></li> </ul> </object></audio>

Page 138: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<video src="my.ogv" controls="controls"></video>

Page 139: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<video controls="controls" width="640" height="480"> <source src="my.m4v"/> <source src="my.webm"/> <source src="my.ogv"/> <!-- fallback --></video>

Page 140: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<video controls="controls" width="640" height="480" poster="my.png"> <source src="my.m4v"/> <source src="my.webm"/> <source src="my.ogv"/> <!-- fallback --></video>

Page 141: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

No MIME, no serviceAddType video/ogg .ogvAddType video/mp4 .mp4AddType video/webm .webm

Page 142: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

FUTURE OF WEB DESIGN NYC 2011

Expansion<video width="600" height="400" poster="/r/2-5.png" controls="controls" preload="none"> <source src="/r/2-5.m4v" type="video/mp4"/> <source src="/r/2-5.webm" type="video/webm"/> <source src="/r/2-5.ogv" type="video/ogg"/> <img src="/r/2-5.png" width="600" height="400" alt=""/> <ul> <li><a href="/r/2-5.m4v">Download as video/mp4</a></li> <li><a href="/r/2-5.webm">Download as video/webm</a></li> <li><a href="/r/2-5.ogv">Download as video/ogg</a></li> </ul></video>

Page 143: HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]

HTML5: Smart Markupfor Smarter Websites

by Aaron Gustafson

More of the same:http://adaptivewebdesign.info

http://easy-designs.nethttp://blog.easy-designs.nethttp://aaron-gustafson.com

This presentation is licensed underCreative Commons Attribution-Noncommercial-Share Alike 3.0

flickr Photo Creditshttp://www.!ickr.com/photos/aarongustafson/galleries/72157627920318847/