HTML5 semantics

109
Welcome back!

description

Resources http://html5doctor.com http://html5demos.com HTML5 resets http://html5doctor.com/html-5-reset-stylesheet/ http://sencss.kilianvalkhof.com

Transcript of HTML5 semantics

Page 1: HTML5 semantics

Welcome back!

Page 2: HTML5 semantics
Page 3: HTML5 semantics

Justin HalsallCTO, betribes

Page 4: HTML5 semantics

Justin HalsallCTO, betribes

Page 5: HTML5 semantics

Passions

Page 6: HTML5 semantics

Tablesnested fail

Page 7: HTML5 semantics

web standards

Page 8: HTML5 semantics

web stuff?!

Page 9: HTML5 semantics

web stuff?!

Page 10: HTML5 semantics
Page 11: HTML5 semantics

wtf?

Page 12: HTML5 semantics

wtf? thats cool!

Page 13: HTML5 semantics

web standards

Page 14: HTML5 semantics

web standards

Page 15: HTML5 semantics

web standards

Page 16: HTML5 semantics

Railscool!

Page 17: HTML5 semantics

RailsRails is

AWESOME!

Page 18: HTML5 semantics
Page 19: HTML5 semantics
Page 20: HTML5 semantics

XHTML 2.0don’t hold your breath

Page 21: HTML5 semantics

backwards compatibleand required all documents to be served as XML

this buwdy aint gonna fly...

its to fat... he he

Page 22: HTML5 semantics

WHATWGWeb Hypertext Application Technology Working Group

Page 23: HTML5 semantics

HTML5W3C + WHATWG

Page 24: HTML5 semantics

Doctypeyou know that long thing you always have to look up

Page 25: HTML5 semantics

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Page 26: HTML5 semantics

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Page 27: HTML5 semantics

<!DOCTYPE html>

Page 28: HTML5 semantics
Page 29: HTML5 semantics

Charsetmeta, bla bla bla utf-8!

Page 30: HTML5 semantics

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

Page 31: HTML5 semantics

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

Page 32: HTML5 semantics

<meta charset="utf-8" />

Page 33: HTML5 semantics
Page 34: HTML5 semantics

<link type="text/css" rel="stylesheet" href="screen.css">

<script type="text/javascript" src="konamicode.js"></script>

Page 35: HTML5 semantics

<link rel="stylesheet" href="screen.css">

<script src="konamicode.js"></script>

Page 36: HTML5 semantics
Page 37: HTML5 semantics
Page 38: HTML5 semantics

Block level <a>Wait, that didn’t used to be valid...

Page 39: HTML5 semantics

<a href="http://thedailymo.com"> <h2>The Daily Mo</h2> <p>An awesome Movember viral app.</p></a>

Page 40: HTML5 semantics

Cleanup time...

Page 41: HTML5 semantics

frame, frameset,noframes

Page 42: HTML5 semantics

frame, frameset,noframesNO MORE

Page 43: HTML5 semantics

acronym was dropped for abbr

Page 44: HTML5 semantics

acronym was dropped for abbr

Page 45: HTML5 semantics

font, big, center& strike

Page 46: HTML5 semantics

font, big, center& strikeNO MORE

Page 47: HTML5 semantics

Semanticswhat do I care?

Page 48: HTML5 semantics

AccessibilityNot just for the blind anymore

Page 49: HTML5 semantics

SEOGoogle is your biggest blind user

Page 50: HTML5 semantics

RepurposingYour web app is your api

Page 51: HTML5 semantics

UsabilitySurprisingly enough

Page 52: HTML5 semantics
Page 53: HTML5 semantics
Page 54: HTML5 semantics
Page 55: HTML5 semantics

related

Page 56: HTML5 semantics

related

Page 57: HTML5 semantics

related

Page 58: HTML5 semantics

related

unrelated

Page 59: HTML5 semantics

happyNew elements!

Page 60: HTML5 semantics

Structure elements “heeeeead, body, section, footer...”

Page 61: HTML5 semantics

<header>great for intros, navigation etc.

Page 62: HTML5 semantics
Page 63: HTML5 semantics
Page 64: HTML5 semantics
Page 65: HTML5 semantics
Page 66: HTML5 semantics

<section>it’s all in the name

Page 67: HTML5 semantics
Page 68: HTML5 semantics
Page 69: HTML5 semantics

<nav>“lets go!”“where to?”“check the nav elements”

Page 70: HTML5 semantics
Page 71: HTML5 semantics
Page 72: HTML5 semantics
Page 73: HTML5 semantics
Page 74: HTML5 semantics

<article> useful for... articles?!

Page 75: HTML5 semantics

<article> useful for... articles?!

Page 76: HTML5 semantics

<aside>sidenotes

Page 77: HTML5 semantics

<footer> metadata related to parent

Page 78: HTML5 semantics

<footer> metadata related to parent

Page 79: HTML5 semantics
Page 80: HTML5 semantics
Page 81: HTML5 semantics

<hgroup>grouping headings together

Page 82: HTML5 semantics

<hgroup> <h1>...</h1> <h2>...</h2></hgroup>

Page 83: HTML5 semantics

HTML Outline

Page 84: HTML5 semantics

HTML4

<div><h1>Forest elephants</h1> <p>In this section, we discuss the lesser known forest elephants. ...this section continues... </div><div><h2>Habitat</h2> <p>Forest elephants do not live in trees but among them. ...this subsection continues... <div><h2>Diet</h2></div><h1>Mongolian gerbils</h1></div>

Page 85: HTML5 semantics

HTML4

<h1>Forest elephants</h1> ...<h2>Habitat</h2> ...<h2>Diet</h2>...<h1>Mongolian gerbils</h1>

Page 86: HTML5 semantics

HTML4

1. Forest elephants

1.1. Habitat

1.2. Diet

2. Mongolian gerbils

<h1>Forest elephants</h1> ...<h2>Habitat</h2> ...<h2>Diet</h2>...<h1>Mongolian gerbils</h1>

Page 87: HTML5 semantics

HTML5

<section><h1>Forest elephants</h1> <p>In this section, we discuss the lesser known forest elephants. ...this section continues... </section><section><h2>Habitat</h2> <p>Forest elephants do not live in trees but among them. ...this subsection continues... <section><h1>Diet</h1></section><h2>Mongolian gerbils</h2></section>

Page 88: HTML5 semantics

HTML5

<section><h1>Forest elephants</h1> </section><section> <h2>Habitat</h2> <section> <h1>Diet</h1> </section> <h2>Mongolian gerbils</h2></section>

Page 89: HTML5 semantics

HTML5

1. Forest elephants

2. Habitat

2.1. Diet

3. Mongolian gerbils <section> <h1>Forest elephants</h1> </section><section> <h2>Habitat</h2> <section> <h1>Diet</h1> </section> <h2>Mongolian gerbils</h2></section>

Page 90: HTML5 semantics

sub headings not interesting in outline

h1h2

Page 91: HTML5 semantics

sub headings not interesting in outline

h1h2

Page 92: HTML5 semantics

HTML5

1. Soocial

1.1. Hassle free contact syncing

1.1.1. Pricing

<section> <h1>Soocial</h1> <h2>Hassle Free contact syncing</h2> <section> <h1>Pricing</h1> </section> ...</section>

Page 93: HTML5 semantics

HTML5

<section> <hgroup> <h1>Soocial</h1> <h2>Hassle Free contact syncing</h2> </hgroup> <section> <h1>Pricing</h1> </section> ...</section>

Page 94: HTML5 semantics

HTML5

<section> <hgroup> <h1>Soocial</h1> <h2>Hassle Free contact syncing</h2> </hgroup> <section> <h1>Pricing</h1> </section> ...</section>

Page 95: HTML5 semantics

HTML5

1. Soocial

1.1. Pricing

<section> <hgroup> <h1>Soocial</h1> <h2>Hassle Free contact syncing</h2> </hgroup> <section> <h1>Pricing</h1> </section> ...</section>

Page 96: HTML5 semantics

<figure> & <figcaption>

images, graphs etc.

Page 97: HTML5 semantics

<figure> & <figcaption>

images, graphs etc.

Page 98: HTML5 semantics

<time><time datetime="2010-11-01">8 days, 8 hrs and 5 min from now</time>

Page 99: HTML5 semantics

<time><time datetime="2010-11-01">8 days, 8 hrs and 5 min from now</time>

Page 100: HTML5 semantics

data- Attributes

Page 101: HTML5 semantics

<a class="movie" href="http://movienotify.com/kick-ass[2010]" data-name="Kick-Ass" data-year="2010" data-imdb-rating="8.1">Kick-Ass (2010)</a>

Page 102: HTML5 semantics

<a class="movie" href="http://movienotify.com/kick-ass[2010]" data-name="Kick-Ass" data-year="2010" data-imdb-rating="8.1">Kick-Ass (2010)</a>

Page 103: HTML5 semantics

<div id='trailer' class='loading'data-src="<%= movie_trailers_path @movie, :json %>"> loading...</div>

Page 104: HTML5 semantics

<div id='trailer' class='loading'data-src="<%= movie_trailers_path @movie, :json %>"> loading...</div>

Page 105: HTML5 semantics
Page 106: HTML5 semantics

HTML5 shiv: http://remysharp.com/2009/01/07/html5-enabling-script/

<script> document.createElement('header'); document.createElement('footer'); document.createElement('section'); ...</script>

Page 107: HTML5 semantics

modernizr.com

<body class="no-multiplebgs ...">

Page 108: HTML5 semantics

Questions?•Twitter: @juice10

•Screenshots:

•movienotify.com

•thedailymo.com

•blog: juice10.com

•pet project: tvnotify.com

•We (Betribes.com) are looking for cool new colleagues. Maybe you?

•E-mail: [email protected]

Page 109: HTML5 semantics

[passion fruit] http://www.flickr.com/photos/stefanvds/3260955737/[tables] http://www.flickr.com/photos/cav666/3562455727/

[ipad stand] http://www.flickr.com/photos/4nton/4577185176/in/photostream/[web] http://www.flickr.com/photos/foxypar4/2124673642/

[shark] http://www.flickr.com/photos/oskay/265899766/in/photostream/[sedgeway] http://www.flickr.com/photos/oskay/265899988/sizes/o/in/photostream/

[smily hand] http://www.flickr.com/photos/dotbenjamin/2765083201/[rails] http://www.flickr.com/photos/library_of_congress/2178402745/

[html5 fist] http://www.flickr.com/photos/justinsomnia/513636061/[skelleton] http://www.flickr.com/photos/powerhouse_museum/2980051095/

[chicken] http://www.flickr.com/photos/uw_digital_images/4476181225/[cleaner] http://www.flickr.com/photos/library_of_congress/

[fireworks] http://www.flickr.com/photos/bestrated1/341866875/[google founders] http://www.wired.com/science/discoveries/news/2007/09/

dayintech_0907