The HTML5 canvas Tag
The HTML5 <canvas> tag is important in enabling on the spot drawing of graphics. It is important though to use scripting, like JavaScript, to be able to utilize the function. The HTML5 <canvas> tag is necessary primarily for containing the graphics. However, the actual drawing of the graphics should be done with the use of script.
The <canvas> tag is newly introduced for HTML5 so this is not found in HTML4.01.
Using the HTML5 <canvas> tag is not really a problem since this is supported by all major web browsers these days such as Google Chrome, Internet Explorer, Safari, Opera and Firefox. In cases wherein the HTML5 <canvas> tag is not supported by the web browser, all texts inside the <canvas> element are shown.
The <canvas> tag is capable of working along with both the Event Attributes and Global Attribute in HTML5. Attributes for the HTML5 <canvas> tag are the following:
Attribute |
Value |
Description |
Height |
pixels |
Specifies the height of the canvas |
width |
pixels |
Specifies the width of the canvas |
It has to be noted that these attributes are new since the HTML5 <canvas> tag is not utilized for HTML4.01.