Intro to HTML5
Scott Vandehey
@spaceninja
- Great history of why HTML5 came into being:
- Long version: diveintohtml5.org/past.html
- Backlash against XHTML2, which would have been too draconian. Would have cause sites with any errors at all to not render. Browser manufacturers hated this.
- HTML5 Design Principles
- Support existing content
- Any new stuff we add should degrade gracefully
- Pave the cowpaths
- Let’s look at the way the community is already doing things. Let’s document how people are actually working, and make sure things work that way.
- Priority of Constituencies
- users > authors > implementors > specifiers > purity
- Joke: HTML = How To Meet Ladies
- Better Forms
- New input types
- telephone (tel)
- url
- number
- and many more…
- ex:
- Only small browser enhancements so far, but it is getting there. On the iPhone browser, for example, they optimize the keyboard for the type of input field.
- prefills the text box with the instructions
- to avoid javascript or server side validate to validate forms.
- in the future browsers will do this, include field type validation
- Create an input field out of anything:
click me to edit
- Better Videos/Media
- Example shown: massive amount of code shown for doing Flash video…
- In HTML5:
- Actually, a little more complex, because each browser supports a different format. But you can encode the video multiple times, and then put the source multiple times.
- New Semantic Elements
- header
- footer
- nav
- aside
- article
- section
- Simplified Elements
- doctype:
- meta:
- No type needed for js and css elements
- How to convert to HTML5 in one easy step
- Just change the doctype to . You’re done. Because everything is backwards compatible.
- Browser shims:
- Add some css:
section, article, header, footer, nav, aside, hgroup {
display: block;
} - Also, add some conditional comments to your head for IE
- Rumors
- Browsers don’t support HTML5
- Wrong. All support it to some extent. There’s no reason not to use the parts that work today.
- Rumor: HTML5 won’t be ready until 2022
- 2009: W3C working draft
- browser manufacturers already working to implementing.
- 2012: W3C recommendation
- 2022: two complete working implementations
- This can be ignored… There aren’t two complete implementations of CSS2.1, but we’ve been using that for years. Browser manufacturers get to 95%, and then they quit implementing the spec.