Skip to content

Instantly share code, notes, and snippets.

@mariiinda
Created April 11, 2013 11:29
Show Gist options
  • Select an option

  • Save mariiinda/5362655 to your computer and use it in GitHub Desktop.

Select an option

Save mariiinda/5362655 to your computer and use it in GitHub Desktop.
canvas-quickstart
<!doctype html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<!--<link rel="stylesheet" href="css/style.css">-->
<style>
body {
background: rgba(33, 33, 33, 0.3);
margin: 0;
padding:0;
}
#canvas {
margin: 20px auto;
display: block;
padding: 0;
box-shadow: 0px 0px 5px #CCC;
}
</style>
</head>
<body>
<canvas id='canvas' width='600' height='460'>
Canvas not supported
</canvas>
<!--<script src="js/script.js"></script>-->
<script>
var canvas = document.querySelector('#canvas');
var context = canvas.getContext('2d');
context.font = "38pt Arial";
context.fillStyle = 'black';
context.fillText('Hello Canvas', canvas.width/2 - 150, canvas.height/2 +15);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment