搜索文档
首页
HTML/CSS
JavaScript
服务端开发
Java教程
移动端
数据库
当前位置:
首页
HTML/CSS
HTML5基础教程
HTML5 图形
源代码
清空
点击运行
<canvas id="ex4" width="500" height="150" style="border: 1px solid #cccccc;"> HTML5 Canvas not supported </canvas> <script> var canvas = document.getElementById("ex4"); var context = canvas.getContext("2d"); var x = 10; var y = 10; var width = 100; var height = 100; context.lineWidth = 4; context.strokeRect(x, y, width, height); </script>
运行结果