Introduction: How to Use the Html5 Canvas Tag

Picture of How to Use the Html5 Canvas Tag

The html5 canvas is not different from the other html canvases.Such as : <p>Text</p>. It has the same build and shape and it looks like this : <canvas> </canvas>. When using the html5 canvas tag there are a few attributes you must use like : <canvas id="canvas" width="400" height="400"></canvas>. Now to import the html5 canvas into js so you can draw shapes and text. The code looks like this :

var c = document.getElementById("canvas");
var ctx = c.getContext("2d");

Now you can learn to draw shapes in the next tutorial see you next time.


seamster (author)2014-10-22

Interesting, thanks for sharing this.

About This Instructable




More by Coder0806:Java Programming Part2(Text and running)Drawing squares with html5 on an html5 canvasJava Programming Part1 (Setting Up Eclipse)
Add instructable to: