What is use of 'canvas' tag in HTML5?

devquora
devquora

Posted On: Feb 22, 2018

 

The <canvas> tag in the HTML is used to create graphics such as boxes, circles using JavaScript. It is only a container for graphics, you have to use JavaScript to design the graphics. It has default methods to create different shapes. It is important to mention width and height while you are creating a canvas element.

Example

<canvas id="myCanvas" width="200" height="100"></canvas>

In the above example, a rectangle is drawn using the canvas tag.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    HTML5 interview questions

    What is HTML5 ?

    HTML5 is the most recent version of the HTML(Hypertext Markup Language). It is a language for structuring and displaying content for the World Wide Web, a core technology of the Internet...

    HTML5 interview questions

    What is < !DOCTYPE>? Is it necessary to use in HTML5 ?

    The &lt; !DOCTYPE&gt; is an instruction to the web browser about what version of HTML the page is written in. AND The &l..

    HTML5 interview questions

    List out the new features of HTML5?

    Some of the most interesting new features in HTML5:The &lt;canvas&gt; element for 2D drawing The &lt;video&gt; and &lt..