+ 11

Can some one please put me through about canvas I'm a little confused

<canvas>

17th Sep 2017, 1:19 PM
Franklyn Omeben
Franklyn Omeben - avatar
2 Answers
+ 5
The canvas tag in html is really only a square box. It's like an artist's blank canvas. To draw in the canvas you'll need your ink, which in this case will be your javascript. You can't actually draw with html. The tag is just the container for your drawing (kinda like your <div> ). when you use the canvas tag you have to specify a height and width. You will also want to give it an id because, I would think you would want your drawing to be unique to whichever canvas you put it on e.g <canvas id="thiscanvas" width="200" height="200" style="border:2px solid #000000;" > </canvas> I added a border so you can see where the canvas starts and end. To draw, you will need to call on the canvas from your js.
17th Sep 2017, 2:54 PM
Isimbabi Jibril
Isimbabi Jibril - avatar
20th Sep 2017, 5:11 PM
Haris
Haris - avatar