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

HTML的canvas标签_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 08:48:08
Original
847 people have browsed it



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>

仔细检查下你敲的代码

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template