public
Last active

<canvas> Hello World, thanks @miketaylr!

  • Download Gist
Canvas Hello World.html
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<html>
<head>
<script>
window.onload = function() {
var ctx = document.querySelector('#c').getContext('2d');
ctx.lineWidth = 20;
ctx.lineCap = 'square';
ctx.lineJoin = 'round';
ctx.strokeStyle = '#c9f'; // 'rgb(247, 63,20)';
ctx.strokeRect(10,10,346,230);
}
</script>
<body>
<canvas id="c" height=400 width=400></canvas>
</body>
</html>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.