Chapter 7. Bringing Out Your Inner Artist: The Canvas

HTML’s been liberated from being just a “markup” language. With HTML5’s new canvas element, you’ve got the power to create, manipulate and destroy pixels, right in your own hands. In this chapter we’ll use the canvas element to bring out your inner artist—no more talk about HTML being all semantics and no presentation; with canvas we’re going to paint and draw with color. Now it’s all about presentation. We’ll tackle how to place a canvas in your pages, how to draw text and graphics (using JavaScript, of course), and even how to handle browsers that don’t support the canvas element. And canvas isn’t just a one-hit wonder; you’re going to be seeing a lot more of canvas in other chapters in this book.
Note
Okay, “destroy” might be a little overly dramatic.
Note
In fact we hear <canvas> and <video> have been sharing more than just web pages... we’ll get into the juicy details later.
Our new start-up: TweetShirt
Our motto is “if it’s worth tweeting on Twitter, it’s worth printing on a t-shirt.”

After all, half the battle of calling yourself a journalist is being willing to put your words in print, so what better place than printing on your or someone else’s chest? At least that’s our start-up pitch, and we’re sticking to it.
Now, there’s only ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access