Canvas Tutorial - Graphics in a browser

The Canvas tag is defined in the new HTML 5 format for web pages, and already implemented on most browsers.
It allows you to display 2D graphics in the browser and thus make it a platform for rich web applications.

How use Canvas

It has only two attributes:width and height, in addition to generic attributes like id, name,class ... Its purpose is to mark the location where you want to insert a drawing surface (technically called "rendering context").

The body of the tag is
not displayed by browsers that implement Canvas but only by others, and
is therefore a means of providing alternative content.

Using Canvas is very simple, the code below shows a minimal application:

<canvas id="c1" width="400" height="100">
Not implemented.
</ canvas>

This has defined a location and its ID, it remains to add a graphic content: