Home >Web Front-end >HTML Tutorial >The function of HTML tag

The function of HTML tag

(*-*)浩
(*-*)浩Original
2019-12-09 14:20:522834browse

HTML 5ba626b379994d53f7acf72a64f9b697 tag

The function of HTML <canvas> tag

##Internet Explorer 9, Firefox, Opera, Chrome and Safari support the 5ba626b379994d53f7acf72a64f9b697 tag .

Note: Internet Explorer 8 and earlier versions do not support the 5ba626b379994d53f7acf72a64f9b697 tag. (Recommended learning: html tutorial)

Definition and usage

5ba626b379994d53f7acf72a64f9b697 tag defines graphics, such as charts and other images.

5ba626b379994d53f7acf72a64f9b697 tags are just graphics containers, you have to use a script to draw the graphics.

Differences between HTML 4.01 and HTML 5

The5ba626b379994d53f7acf72a64f9b697 tag is a new tag in HTML 5.

Example

How to display a red rectangle through the canvas element:

<!DOCTYPE HTML>
<html>
<body>

<canvas id="myCanvas">your browser does not support the canvas tag </canvas>

<script type="text/javascript">

var canvas=document.getElementById(&#39;myCanvas&#39;);
var ctx=canvas.getContext(&#39;2d&#39;);
ctx.fillStyle=&#39;#FF0000&#39;;
ctx.fillRect(0,0,80,100);

</script>

</body>
</html>

The above is the detailed content of The function of HTML tag. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Related articles

See more