+ 11
Can some one please put me through about canvas I'm a little confused
<canvas>
2 ответов
+ 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.
0
An intro to canvas:
https://code.sololearn.com/W4Db30CeCN4A/?ref=app