<html><body><h1>HTML5 Canvas</h1><h2>lineWidth 属性</h2><canvas id="myCanvas" width="200" height="100" style="border:1px solid grey;"></canvas><script>const canvas = document.getElementById("myCanvas");const ctx = canvas.getContext("2d");ctx.beginPath();ctx.moveTo(0,0);ctx.lineTo(200,100);ctx.lineWidth = 10;ctx.stroke();</script></body></html>