HTML5 - Introduction
HTML5 - New Elements
HTML5 - Removed Elements
HTML5 - Browser Check
Tag Name : canvas
The 'canvas' tag provides a container for graphical elements to be drawn. As the name suggests, it is a canvas over which different shapes can be drawn using javascript. The following example shows how to draw a rectangle and fill it with a color.
HTML Example :
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>

<canvas id="canvas"></canvas>

<script>
var c=document.getElementById("canvas");
var ctx=c.getContext("2d");
ctx.fillStyle="#FFFF00";
ctx.fillRect(0,0,110,175);
</script>

</body>
</html>
Output :

© 2010 www.generalconnection.com. All rights reserved. | www.generalconnection.com