Introduction to HTML5

A presentation at WebVisions Portland 2011 in May 2011 in Portland, OR, USA by Scott Vandehey

Slide 1

Slide 1

Introduction to HTML5 Scott Vandehey Front-End Web Developer ELC Technologies @spaceninja

Slide 2

Slide 2

Why make a new version of HTML? (For the long version:) diveintohtml5.org/past.html

Slide 3

Slide 3

HTML5 Design Principles ref: bit.ly/html-principles Image credit: Dale Stephanos

Slide 4

Slide 4

Photo credit: Jacinta Lodge Support Existing Content

Slide 5

Slide 5

Photo credit: Kevin Simpson Degrade Gracefully

Slide 6

Slide 6

Photo credit: Jeremy Keith Pave the Cowpaths

Slide 7

Slide 7

Photo credit: Ian “Bluemoose” Priority of Constituencies USERS > AUTHORS > IMPLEMENTORS > SPECIFIERS > PURITY

Slide 8

Slide 8

Photo credit: Kris Krug Top 3 New Features

Slide 9

Slide 9

  1. Better Forms new input types placeholder and many more!

Slide 10

Slide 10

New input types <input type=”email”> <input type=”tel”> <input type=”url”> <input type=”number”> and many more!

Slide 11

Slide 11

Slide 12

Slide 12

Search <input type=”search”>

Slide 13

Slide 13

Placeholder <input placeholder=”your name”>

Slide 14

Slide 14

Validation <input required>

Slide 15

Slide 15

ContentEditable <div contenteditable> Click on me to edit! </div>

Slide 16

Slide 16

Slide 17

Slide 17

  1. Rich Media video & audio

Slide 18

Slide 18

Recognize this? <object classid=”clsid:d27cdb6e-ae6d-11cf-96b8-444553540000” width=”640” height=”360” codebase=”http:// download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=6,0,40,0”><param name=”flashvars” value=”guid=BQtfIEY1&amp;width=640&amp;height=360&amp;locksiz e=no&amp;dynamicseek=false&amp;qc_publisherId=p-18mFEk4J448M” /><param name=”src” value=”http://v.example.com/ media/plugins/video/flvplayer.swf?ver=1.21” /><param name=”wmode” value=”transparent” /><param name=”allowfullscreen” value=”true” /><embed type=”application/x-shockwave-flash” width=”640” height=”360” src=”http://v.example.com/media/plugins/video/flvplayer.swf? ver=1.21” allowfullscreen=”true” wmode=”transparent” flashvars=”guid=BQtfIEY1&amp;width=640&amp;height=360&amp;loc ksize=no&amp;dynamicseek=false&amp;qc_publisherId=p-18mFEk4J448M”></embed></object>

Slide 19

Slide 19

That’s better <video src=”movie.mp4”></video>

Slide 20

Slide 20

Multiple sources <video controls width=”360” height=”240”> <source src=”movie.webm” type=’video/webm; codecs=”vp8, vorbis”’> <source src=”movie.ogv” type=’video/ogg; codecs=”theora, vorbis”’> <source src=”movie.mp4” type=’video/mp4; codecs=”avc1.42E01E, mp4a.40.2”’> </video>

Slide 21

Slide 21

Multiple fallbacks <video controls width=”360” height=”240”> <source …> <source …> <source …> <object> … flash stuff here … <a href=”movie.mp4”>Download the movie.</a> </object> </video>

Slide 22

Slide 22

Safari 3+ Firefox 3.5+ Chrome 3+ IE8 (flash)

Slide 23

Slide 23

  1. New Semantic Elements header & footer nav & aside section & article and many more!

Slide 24

Slide 24

Image credit: A List Apart

Slide 25

Slide 25

Image credit: A List Apart

Slide 26

Slide 26

  1. Simplified Elements doctype charset script & style

Slide 27

Slide 27

Doctype & Charset <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict //EN” “http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>

<!DOCTYPE html> <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8” /> <meta charset=”UTF-8”>

Slide 28

Slide 28

No type for JS & CSS <script type=”text/javascript” src=”x.js”></script>

<script src=”x.js”></script> <link type=”text/css” rel=”stylesheet” media=”screen” href=”x.css” /> <link rel=”stylesheet” media=”screen” href=”x.css”>

Slide 29

Slide 29

How to convert your site to HTML5 in one easy step

Slide 30

Slide 30

It’s Easy! Change this: <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”> to this: <!DOCTYPE html>

Slide 31

Slide 31

Browser shims Add this to your stylesheet: section, article, header, footer, nav, aside, hgroup { display: block; } Add this conditional comment to your head: <!—[if IE]> <script src=”http://html5shim.googlecode.com/ ↩ svn/trunk/html5.js”></script> <![endif]—>

Slide 32

Slide 32

Rumor: Browsers don’t support HTML5 False: All modern browsers have implemented HTML5 to some degree, and there’s no reason not to use the parts that work today.

Slide 33

Slide 33

Rumor: HTML5 won’t be ready until 2022 False: 2009: W3C Working Draft 2012: W3C Recommendation 2022: two complete implementations

Slide 34

Slide 34

Rumor: HTML5 takes us back to tag soup False: HTML5 allows you to use HTML or XHTML syntax.

Slide 35

Slide 35

Thank You To learn more: abookapart.com diveintohtml5.org Follow me on Twitter: @spaceninja </presentation>