When writing in HTML, the tag is a block element used to draw graphics through the use of a scripting language like JavaScript. It is useful when you want to create graphs or perform simple animations on the fly. The following sections contain information about this tag, including an example of its code, and related attributes and browser compatibility.

Example of code

Unfortunately, your browser doesn’t support the canvas element.

Attributes

Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all of the current unique HTML attributes for the tag, and a description of each.

  • Example of code
  • Attributes
  • Compatibility
  • Related information

Compatibility

Animation, Browser, Compatibility, Container tag, Web design terms

  • HTML and web design help and support.