1<style>
2 .main-canvas {
3 margin: 20px;
4 border: 1px solid black;
5 }
6</style>
7
8<canvas width="600" height="400" class="main-canvas"></canvas>
9
10const canvas = document.querySelector('.main-canvas');
11const ctx = canvas.getContext('2d');
12
13ctx.fillRect(200, 100, 200, 200);