Menu Home

canvas

osbo.com | HTML | Elements | 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

Global

Name Value Description
height non-negative integer Vertical dimension
width non-negative integer Horizontal dimension

Examples

height

width

CSS

JS

Web Hypertext Application Technology Working Group (WHATWG)