Skip to main content

html-tags.com

<canvas>

A scriptable bitmap surface for dynamic graphics, games, and visualizations.

Baseline: Widely available · Media & embedded content

When to use it

Only with JavaScript driving it; provide fallback content inside, and prefer SVG when the graphic is document-like.

When not to

Canvas content is invisible to assistive technology and search — never render text or UI into it that has no DOM counterpart.

Key attributes

width / height
bitmap dimensions

Example

<canvas width='320' height='160'>
  <p>Fallback: your browser can't render the chart; the data is in the table below.</p>
</canvas>
Source — this snippet needs a fuller context to render.

Authoritative references