<canvas>
element is used to draw graphics on a web page.<canvas>
. It shows four elements: a red rectangle, a gradient rectangle, a multicolor rectangle, and a multicolor text.<canvas>
element is used to draw graphics, on the fly, via JavaScript.<canvas>
element is only a container for graphics. You must use JavaScript to actually draw the graphics.<canvas>
element.Element | |||||
---|---|---|---|---|---|
<canvas> | 4.0 | 9.0 | 2.0 | 3.1 | 9.0 |
id
attribute (to be referred to in a script), and a width
and height
attribute to define the size of the canvas. To add a border, use the style
attribute.<canvas>
, please read our HTML Canvas Tutorial.