# <canvas>

• Is used to draw graphics on a web page.
• Is only a container for graphics.
• You must use JavaScript to actually draw the graphics.
• Is a rectangular area on an HTML page.
• By default, a canvas has no border and no content.

#### Demonstration code

//here is an example of a basic, empty canvas

<canvas id="myCanvas" width="200" height="100" style="border:1px solid #000000;">
</canvas>

#### Demonstration code

//Draw a Circle

var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.arc(95, 50, 40, 0, 2 * Math.PI);
ctx.stroke();

#### Demonstration code

//Draw Linear Gradient

var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");

var grd = ctx.createLinearGradient(0, 0, 200, 0);

ctx.fillRect(10, 10, 150, 80);