Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>HTML5 Canvas - Draw a Rectangle</h1>
<canvas id="myCanvas" width="200" height="100" style="border:1px solid black;">
Sorry, your browser does not support canvas.
</canvas>
<script>
const canvas = document.getElementById("myCanvas");
const ctx = canvas.getContext("2d");
ctx.fillStyle = "red";
ctx.fillRect(0,0,150,75);
</script>
</body>
</html>