Menu
The canvas
tag is used to draw graphics and animations on the fly, usually with JavaScript.
Use the height
and width
attributes to set the dimensions of the canvas area in pixels. Height defaults to 150. Width defaults to 300.
<canvas id="canvas" width="600" height="600">
Text to display if the browser does not support the canvas element.
</canvas>
height
Sets the height in pixels.
width
Sets the width in pixels.
User-submitted codepen.io examples of <canvas>
↴
Submit a codepen.io link that demonstrates <canvas>
: