Home >Web Front-end >HTML Tutorial >HTML的canvas标签_html/css_WEB-ITnose

HTML的canvas标签_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 08:48:08849browse



Your browser does not support the canvas element.

<script> <br /> var c=document.getElementById("myCanvas"); <br /> var cxt=c.getContext("2d"); <br /> cxt.moveTo(20,20); <br /> cxt.lineTo(150,50); <br /> cxt.lineTo(2o,50); <br /> cxt.stroke(); <br /> </script>

代码如上,但是运行时只有一个矩形框,框内没有画的这两条线,怎么回事?


回复讨论(解决方案)

1. <script>写错了 javascript 是i不是o <br /> <br />2. cxt.lineTo(2o,50); 是0不是“O” </script>

仔细检查下你敲的代码

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