Pr.Pg Next Pg

<Canvas> tag tutorials

  • The HTML5 <canvas> element is used to draw graphics, on the fly, via scripting (usually JavaScript).

  • The <canvas> element is only a container for graphics. You must use a script to actually draw the graphics.

  • Canvas has several methods for drawing paths, boxes, circles, characters, and adding images.

  • A canvas is a rectangular area on an HTML page, and it is specified with the <canvas> element.

  • Note: By default, the <canvas> element has no border and no content.

  • The <canvas> tag is supported in Chrome, Firefox, Opera, Internet Explorer 9+ and Safari.

Note: The <canvas> tag do not support Internet Explorer 8 and earlier versions.




<canvas attributes= value…></canvas>



Example: HTML program to demonstrate canvas

Pr.Pg border                                              Next Pg