canvas
Definition and Usage
The <canvas> tag is used to draw graphics, on the fly, via scripting (usually JavaScript).The <canvas> tag is only a container for graphics, you must use a script to actually draw the graphics. . This can, for instance, be used to draw graphs, make photo composition or simple (and not so simple) animations. It can be used for rendering graphs, game graphics, or other visual images.The HTML <canvas> element is used to draw graphics on a web page.The graphic to the left is created with <canvas>. It shows four elements: a red rectangle, a gradient rectangle, a multicolor rectangle, and a multicolor text. Use the HTML<canvas>
element with the canvas scripting API to draw graphics and animations.
Syntax
To draw on the canvas, the<canvas>
tag is used in conjunction with the getContext(contextId)
method.
Any content between the <canvas>
</canvas>
tags is "fallback content"- meaning, it will be displayed only if the canvas cannot be displayed.