HTML5 has made it very easy to draw graphics on a web page with the help of Javascript. Canvas is actually used as a container of a graphic which has not border and no content in it. Actual graphic is written using Javascript. Now you can not only draw simple graphics but can render game graphics, photo compositions, other visual images on the fly. You can give various effects like coloring, multicoloring figures or text, gradiant etc with the use of canvas.
The HTML5 <canvas> Tag has many attributes like width, height, style, class, id and name which you can use as and when required.
Syntax
Almost all latest browsers like Safari, Google Chrome, Mozilla Firefox, Opera, Internet Explorer 9.0 support many HTML5 features and functionalities. The good thing is that now many mobiles web browsers like iPhones, iPads, and Android phones all have excellent support for HTML5.
This will produce following result
This will produce following result