HTML Intro

HTML Intro Quiz

HTML Intro Exercise

HTML Basics

HTML Basic Quiz

HTML Basic Exercise

HTML Advance

HTML Advance Quiz

HTML Advance Exercise

HTML Tags List

HTML Global Attributes

HTML Attributes


HTML canvas Tag

HTML canvas Tag



The canvas tag is used to draw graphics, on the fly, via JavaScript. It is a transparent container and we have to use a script to actually draw the graphics. Text between the canvas tag will be displayed if the browser does not support the canvas element.


Attribute Explanation:-


Attribute Value Description
height pixels Specifies the height of the canvas. The default value is 150
width pixels Specifies the width of the canvas Default value is 300


Canvas Coordinates:-


The HTML canvas is a two-dimensional grid. The upper-left corner of the canvas has the coordinates (0,0).

  • coordinate increases to the right.
  • coordinate increases toward the bottom of the canvas.




Its syntax is:- < canvas >

Code Explanation

All Tutorials related to HTML Tags List

All Sections related to HTML