Preface

Diving In

What is HTML5? HTML5 is the next generation of HTML, superseding HTML 4.01, XHTML 1.0, and XHTML 1.1. HTML5 provides new features that are necessary for modern web applications. It also standardizes many features of the web platform that web developers have been using for years, but that have never been vetted or documented by a standards committee. (Would it surprise you to learn that the Window object has never been formally documented? In addition to the new features, HTML5 is the first attempt to formally document many of the “de facto” standards that web browsers have supported for years.)

Like its predecessors, HTML5 is designed to be cross-platform. You don’t need to be running Windows or Mac OS X or Linux or Multics or any particular operating system in order to take advantage of HTML5. The only thing you do need is a modern web browser. There are modern web browsers available for free for all major operating systems. You may already have a web browser that supports certain HTML5 features. The latest versions of Apple Safari, Google Chrome, Mozilla Firefox, and Opera all support many HTML5 features. (You’ll find more detailed browser compatibility tables throughout this book.) The mobile web browsers that come preinstalled on iPhones, iPads, and Android phones all have excellent support for HTML5. Even Microsoft has announced that the upcoming Version 9 of Internet Explorer will support some HTML5 functionality.

This book will focus on eight topics:

  • New semantic elements like <header>, <footer>, and <section> (Chapter 3)

  • Canvas, a two-dimensional drawing surface that you can program with JavaScript (Chapter 4)

  • Video that you can embed on your web pages without resorting to third-party plug-ins (Chapter 5)

  • Geolocation, whereby visitors can choose to share their physical locations with your web application (Chapter 6)

  • Persistent local storage without resorting to third-party plug-ins (Chapter 7)

  • Offline web applications that work even after network access is interrupted (Chapter 8)

  • Improvements to HTML web forms (Chapter 9)

  • Microdata that lets you create your own vocabularies beyond HTML5 and extend your web pages with custom semantics (Chapter 10)

HTML5 is designed, as much as possible, to be backward compatible with existing web browsers. New features build on existing features and allow you to provide fallback content for older browsers. If you need even greater control, you can detect support for individual HTML5 features (Chapter 2) using a few lines of JavaScript. Don’t rely on fragile browser sniffing to decide which browsers support HTML5! Instead, test for the features you need using HTML5 itself.

Get HTML5: Up and Running now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.