From c012f70ac3c872e3d557151f45deaf2a4e23a506 Mon Sep 17 00:00:00 2001 From: Pranati Dutta Roy <38241932+pranatidutta@users.noreply.github.com> Date: Fri, 7 Dec 2018 20:00:37 +1100 Subject: [PATCH] Add the section "## Usage" (#30251) * Add the section "## Usage" * Added code formatting to OP's PR --- guide/english/canvas/index.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/guide/english/canvas/index.md b/guide/english/canvas/index.md index 1ba85a171d..c50e47493c 100644 --- a/guide/english/canvas/index.md +++ b/guide/english/canvas/index.md @@ -5,9 +5,23 @@ title: Canvas Canvas is a technology introduced in HTML5 which can be accessed by the `` tag. It allows graphics to be drawn via Javascript, and is a powerful tool for interactivity on all modern web browsers. Learn how to draw shapes, manipulate photos, build games, and animate virtually anything following the links below! -#### More Information: +## Usage + +```html + + + + + + +``` + +1. In the above example, the `"id=myCanvas"` attribute is referred by JavaScript. +2. The `"width"` & `"height"` attributes are necessary to define the size of the canvas. +3. By default, `` element has no border & no content. So, to add a border we use the `"style"` attribute. +4. We can have multiple `` elements on one HTML page. + +#### More Information - [MDN Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API) - [HTML Canvas Deep Dive](https://joshondesign.com/p/books/canvasdeepdive/title.html) - -