Tuesday, 21 July 2015

HTML5 Canvas Tutorial

The canvas is employed to draw graphics using scripting.It is also used to draw graphs, make photo compositions or do simple animations. Almost all the browser support support the html canvas tutorial

You can also create canvas, Basically it is a rectangular area on a HTML page which has attribute like- id, class, width, and height.

Example:

<canvas id=”myCanvas” width=”300″ height=”150″></canvas>

To make a border through canvas use style attributes.

Example:

<!DOCTYPE html>
<html>
<body><canvas id=”myCanvas” width=”300″ height=”150″ style=”border:1px solid #000000;”>
</canvas></body>
</html>

Output: 









Attribute Used:

Attribute Value Description
title text It specifies a title to keep company with the component,several browser can show this once the pointer hovers the component.
id id It defines unique id for an element.
class classname It defines the element class name.
lang URL It Sets the language code.
style style_definition It defines Helps to include inline cascading style sheet.

No comments:

Post a Comment