O'Reilly logo

Introducing HTML5, Second Edition by Remy Sharp, Bruce Lawson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5: Canvas

Remy Sharp

IF THE VIDEO ELEMENT is the poster boy of HTML5, the canvas element is definitely the Han Solo of HTML5. It’s one of the larger parts of the HTML5 specification, and in fact the canvas API, the 2D drawing context, has been split into a separate document, though the canvas element itself is still part of the official HTML5 spec.

The canvas element provides an API for two-dimensional drawing—lines, fills, images, text, and so on. The API has already been used in a huge range of situations, including (interactive) backgrounds to websites, navigation elements, graphing tools, full-fledged applications, games, and emulators. Who knew Super Mario canvas-based games would open the eyes of so many developers!

If you think ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required