Skip to content

Instantly share code, notes, and snippets.

@artlung
Created February 20, 2010 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artlung/309748 to your computer and use it in GitHub Desktop.
Save artlung/309748 to your computer and use it in GitHub Desktop.
<canvas> Hello World, thanks @miketaylr!
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment