1. Technology

The CANVAS Tag

By

HTML CANVAS Tag

< Previous | HTML 5 Tags | HTML 4.01 Tags / XHTML 1.0 Elements | Next >

Free HTML Class | HTML Validators

CANVAS Description:

The CANVAS tag is an HTML5 element that can be used to draw graphics dynamically on the web page using scripts like JavaScript. You can use the canvas tag to draw graphs, create photo compositions, or even create animations and games.

The CANVAS tag is new in HTML5.

DTD: HTML5: <!doctype html>

CANVAS Web Browser Support:

CANVAS HTML Versions

CANVAS Attributes:

Global attributes, event attributes and:

  • height
  • width

CANVAS End Tag:

required </canvas>

CANVAS Contents:

Text to display if the CANVAS tag isn't supported.

Tags valid as content: Flow elements, Phrasing elements plus character data

CANVAS Usage:

Tags valid as container: Flow elements, Phrasing elements

CANVAS Special Notes:

By including text inside the start and end tags, you can alert older browsers that they are not getting the full features of the page. This is something like alternative text for images.

More CANVAS Information:

< Previous | HTML 5 Tags | HTML 4.01 Tags / XHTML 1.0 Elements | Next >

Free HTML Class | HTML Validators

 

©2014 About.com. All rights reserved.