![]() |
VOOZH | about |
The <canvas> tag in HTML is used to draw graphics on a web page using JavaScript. It can be used to draw paths, boxes, texts, gradients, and adding images. By default, it does not contain borders and text.
<canvas id = "script"> Contents... </canvas>Note: The <canvas> tag is new in HTML5.
The <canvas> tag accepts two attributes which are described below:
Attributes | Descriptions |
|---|---|
This attribute is used to set the height of the canvas by taking the value in pixels and its default value is 150. | |
This attribute is used to set the width of the canvas by taking the value in pixels and its default value is 300. |