3 window.onload = function () {
4 var ctx = document.getElementById('c').getContext('2d');
5 ctx.fillStyle = 'green';
6 ctx.fillRect(0, 0, 100, 100);
7 ctx.fillStyle = 'blue';
8 ctx.fillRect(10, 10, 80, 80);
10 ctx.fillRect(20, 20, 60, 60);
13 <p>The canvas below should contain green, blue and red nested squares, all centered with respect to each other.</p>
14 <canvas id="c" width="100" height="100"></canvas>