<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <!-- <link rel="stylesheet" href="./bootstrap本地文档/css/bootstrap.css"> <script src="./bootstrap本地文档/js/jquery-1.12.4.min.js"></script> <script src="./bootstrap本地文档/js/bootstrap.js"></script> --> <style> canvas{ border: 1px solid #000; display: block; margin: 50px auto; width: 1024px; height: 768px; } </style></head><body> <canvas id="canvas"></canvas> <script> window.onload = function () { var canvas = document.getElementById('canvas') var context = canvas.getContext('2d') context.width = 1024; context.height = 768; context.moveTo(0,0); context.lineTo(700,700) context.stroke() } </script></body></html>
weixin_慕用5267334
2019-12-20
1 回答
举报
0/150
提交
取消