<!DOCTYPE HTML> <html> <body> <canvas id="arcCanvas" width="200" height="100" style="border:1px solid #c3c3c3;"> Your browser does not support the canvas element. </canvas> <canvas id="lineCanvas" width="200" height="100" style="border:1px solid #c3c3c3;"> Your browser does not support the canvas element. </canvas> <canvas id="grdCanvas" width="200" height="100" style="border:1px solid #c3c3c3;"> Your browser does not support the canvas element. </canvas> <canvas id="imageCanvas" width="80" height="175" style="border:1px solid #c3c3c3;"> Your browser does not support the canvas element. </canvas> <script type="text/javascript"> var c=document.getElementById("arcCanvas"); var cxt=c.getContext("2d"); cxt.fillStyle="#FF0000"; cxt.beginPath(); cxt.arc(70,18,15,0,Math.PI*2,true); cxt.closePath(); cxt.fill(); </script> <script type="text/javascript"> var c=document.getElementById("lineCanvas"); var cxt=c.getContext("2d"); cxt.moveTo(10,10); cxt.lineTo(150,50); cxt.lineTo(10,50); cxt.stroke(); </script> <script type="text/javascript"> var c=document.getElementById("grdCanvas"); var cxt=c.getContext("2d"); var grd=cxt.createLinearGradient(0,0,175,50); grd.addColorStop(0,"#FF0000"); grd.addColorStop(1,"#00FF00"); cxt.fillStyle=grd; cxt.fillRect(0,0,175,50); </script> <script type="text/javascript"> var c=document.getElementById("imageCanvas"); var cxt=c.getContext("2d"); var img=new Image() img.src="flower.jpg" cxt.drawImage(img,0,0); </script> <br> <br> <br>localStorage <br> <script type="text/javascript"> localStorage.lastname="Smith"; document.write(localStorage.lastname); </script> <br> <br> <script type="text/javascript"> if (localStorage.pagecount) { localStorage.pagecount=Number(localStorage.pagecount) +1; } else { localStorage.pagecount=1; } document.write("Visits "+ localStorage.pagecount + " time(s)."); </script> <form action="/example/html5/demo_form.asp" method="get"> E-mail: <input type="email" name="user_email" /><br /> Homepage: <input type="url" name="user_url" /><br /> Points: <input type="number" name="points" min="1" max="10" /><br /> Points: <input type="range" name="points" min="1" max="10" /><br /> Date: <input type="date" name="user_date" /><br /> Month: <input type="month" name="user_date" /><br /> Week: <input type="week" name="user_date" /><br /> Time: <input type="time" name="user_date" /><br /> Date and time: <input type="datetime" name="user_date" /><br /> Date and time: <input type="datetime-local" name="user_date" /><br /> Webpage: <input type="url" list="url_list" name="link" /> <datalist id="url_list"> <option label="W3School" value="http://www.w3school.com.cn" /> <option label="Google" value="http://www.google.com" /> <option label="Microsoft" value="http://www.microsoft.com" /> </datalist> <input type="submit" /> </form> </body> </html>
详细解决方案
初始学习HTML5-练习
热度:392 发布时间:2012-10-10 13:58:11.0
相关解决方案
- 求“HTML5”实现的图表/报表插件解决办法
- 求“HTML5”兑现的图表/报表插件
- HTML5 3D图,该怎么解决
- html5+.net联合开发的有关问题
- HTML5 离线效能详解 - 构建 Offline Web Application
- HTML5,该如何解决
- HTML5+css3的学习网站
- HTML5/CSS3培训课程
- HTML5 Canvas双缓存范例
- html5 在线制造ppt
- Html5 Canvas的充分运用:适用示例
- 学习:HTML5 游戏《银河系的掠取》图片加载进度条
- HTML5 Canvas简略动画:圆周运动
- HTML5 aria- and role
- 小编者 HTML5 的 placeholder属性
- JavaScript模拟QQ签字(HTML5 contenteditable属性)
- 8款独具一格的 jQuery/HTML5 应用插件
- HTML5 Canvas之猜数目字游戏
- 您应该知道的10个奇特的 HTML5 单页网站
- html5 上传适用小例子
- HTML5+CSS3课程1
- HTML5+CSS3课程2
- HTML5 Canvas 流程图作图
- HTML5 Canvas遇到的几个小问题
- 图表作图 HTML5
- HTML5 兑现拖拽
- HTML5 App实战(六):拼图游戏
- HTML5 window/iframe跨域传接消息 API
- HTML5 服务器发送事件(Server-Sent Events)引见
- HTML5 Canvas中兑现文字链接