canvas

The canvas HTML element provides scripts with a resolution-dependent bitmap canvas, which can be used for rendering graphs, game graphics, art, or other visual images on the fly.

Syntax

HTML

<canvas attribute-name="attribute-value"></canvas>

Attributes

NameValueDescription
heightnon-negative integerVertical dimension
widthnon-negative integerHorizontal dimension

Examples

1 · height

2 · width

3 · CSS

4 · JS · element

5 · JS · style

HomeMenu