Created
September 20, 2012 14:46
-
-
Save hendriklammers/3756354 to your computer and use it in GitHub Desktop.
html: Canvas starter page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Canvas</title> | |
<style> | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
html, body { | |
height: 100%; | |
width: 100%; | |
} | |
canvas { | |
display: block; | |
margin: 0 auto; | |
} | |
</style> | |
</head> | |
<body> | |
<canvas id="my-canvas" width="760" height="500"></canvas> | |
<script> | |
(function() { | |
var canvas = document.getElementById('my-canvas'), | |
context; | |
if (canvas.getContext) { | |
context = canvas.getContext('2d'); | |
} else { | |
alert('You need a modern browser to view this'); | |
} | |
})(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment