<canvas id="canvasexample1" width="300" height="200" style="background: whitesmoke;"></canvas>
<script>
  var c=document.getElementById("canvasexample1");
  var ctx=c.getContext("2d");
  ctx.fillStyle ="#4CAF50";
  ctx.fillRect(20,20,100,100);
</script>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.