In this topic, we described about the <canvas> tag along with detailed example.
<canvas> tag will act as a container. The tag can be represented like <canvas id=""></canvas>. The recent versions of the browsers support the <canvas> tag.
Any content in between the <canvas></canvas> tags will display when the browser doesn’t support <canvas> tag which also called as "fallback content".
<canvas>.. text here.. </canvas>
Optional Attributes -
|width||Specifies width in pixels.||Number in pixels. Default value is 300.|
|height||Specifies height in pixels.||Number in pixels. Default value is 150.|
<!DOCTYPE html> <html> <head> <title> Canvas element example.. </title> </head> <body> <canvas id="square" width="200" height="100" style="border:2px solid #000000;"> Browser not supporting canvas tag </canvas> </body> </html>