HTML Canvas Graphics:
The HTML <canvas> element is used to draw graphics on a web page.
A canvas is a rectangular area on an HTML page. A canvas has no border and no content.
What is HTML Canvas?
HTML5 element <canvas> gives you an easy and powerful way to draw graphics using JavaScript. It can be used to draw graphs, make photo compositions or do simple (and not so simple) animations.
Canvas has several methods for drawing paths, boxes, circles, text, and adding images.
Here is a simple <canvas> element which has only two specific attributes width and height plus all the core HTML5 attributes like id, name and class, etc.
Code for canvas element in HTML5:
<canvas id="myCanvas" width="500" height="500">
The content goes here...
</canvas>
This will output a blank container for drawing graphics. The graphics inside the container can be drawn via JavaScript.
Happy Learning!
No comments:
Post a Comment
Comments